{
 "cells": [
  {
   "cell_type": "code",
   "execution_count": 181,
   "metadata": {},
   "outputs": [],
   "source": [
    "##因为老师需要我们采用不同的算法，所以我们需要采用不同的算法进行分析\n",
    "##.LightGBM\n",
    "##.RandomForest\n",
    "##.XBoost\n",
    "##.深度学习(基于pytorch框架） \n",
    "########我在学pytorch\n",
    "####我们硬件其实不是很好，许老师又把我们的机器学习机器关了，大家到kaggle上跑，提交，判分结果截个图发群里我就知道大家起码看一遍了\n",
    "#####提交有格式要求的，能提交起码能大概看懂代码了，起码借助解释能看懂模型，我觉得就可以了\n",
    "######一定要跑一遍啊，动动手要不问起来很慌"
   ]
  },
  {
   "cell_type": "markdown",
   "metadata": {},
   "source": [
    "1.统一的数据处理部分"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 2,
   "metadata": {},
   "outputs": [],
   "source": [
    "#############################首先针对数据进行预处理\n",
    "#############################原生数据由Kaggle提供，为第一周的covid世界传播数据"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 2,
   "metadata": {},
   "outputs": [],
   "source": [
    "import numpy as np\n",
    "import pandas as pd\n",
    "import matplotlib.pyplot as plt"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 3,
   "metadata": {},
   "outputs": [],
   "source": [
    "pd.set_option(\"display.max_columns\",100)\n",
    "train_path=r\"..\\kaggle\\covid-first\\train.csv\"\n",
    "test_path=r\"..\\kaggle\\covid-first\\test.csv\""
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 4,
   "metadata": {},
   "outputs": [],
   "source": [
    "df_train=pd.read_csv(train_path)\n",
    "df_test=pd.read_csv(test_path)"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 5,
   "metadata": {},
   "outputs": [
    {
     "name": "stdout",
     "output_type": "stream",
     "text": [
      "(17892, 8)\n",
      "(12212, 6)\n"
     ]
    }
   ],
   "source": [
    "print(df_train.shape)\n",
    "print(df_test.shape)  ###############很显然测试机缺少了确诊数以及致死率"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 6,
   "metadata": {
    "scrolled": true
   },
   "outputs": [
    {
     "data": {
      "text/html": [
       "<div>\n",
       "<style scoped>\n",
       "    .dataframe tbody tr th:only-of-type {\n",
       "        vertical-align: middle;\n",
       "    }\n",
       "\n",
       "    .dataframe tbody tr th {\n",
       "        vertical-align: top;\n",
       "    }\n",
       "\n",
       "    .dataframe thead th {\n",
       "        text-align: right;\n",
       "    }\n",
       "</style>\n",
       "<table border=\"1\" class=\"dataframe\">\n",
       "  <thead>\n",
       "    <tr style=\"text-align: right;\">\n",
       "      <th></th>\n",
       "      <th>Id</th>\n",
       "      <th>Province/State</th>\n",
       "      <th>Country/Region</th>\n",
       "      <th>Lat</th>\n",
       "      <th>Long</th>\n",
       "      <th>Date</th>\n",
       "      <th>ConfirmedCases</th>\n",
       "      <th>Fatalities</th>\n",
       "    </tr>\n",
       "  </thead>\n",
       "  <tbody>\n",
       "    <tr>\n",
       "      <th>0</th>\n",
       "      <td>1</td>\n",
       "      <td>NaN</td>\n",
       "      <td>Afghanistan</td>\n",
       "      <td>33.0</td>\n",
       "      <td>65.0</td>\n",
       "      <td>2020/1/22</td>\n",
       "      <td>0</td>\n",
       "      <td>0</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>1</th>\n",
       "      <td>2</td>\n",
       "      <td>NaN</td>\n",
       "      <td>Afghanistan</td>\n",
       "      <td>33.0</td>\n",
       "      <td>65.0</td>\n",
       "      <td>2020/1/23</td>\n",
       "      <td>0</td>\n",
       "      <td>0</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>2</th>\n",
       "      <td>3</td>\n",
       "      <td>NaN</td>\n",
       "      <td>Afghanistan</td>\n",
       "      <td>33.0</td>\n",
       "      <td>65.0</td>\n",
       "      <td>2020/1/24</td>\n",
       "      <td>0</td>\n",
       "      <td>0</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>3</th>\n",
       "      <td>4</td>\n",
       "      <td>NaN</td>\n",
       "      <td>Afghanistan</td>\n",
       "      <td>33.0</td>\n",
       "      <td>65.0</td>\n",
       "      <td>2020/1/25</td>\n",
       "      <td>0</td>\n",
       "      <td>0</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>4</th>\n",
       "      <td>5</td>\n",
       "      <td>NaN</td>\n",
       "      <td>Afghanistan</td>\n",
       "      <td>33.0</td>\n",
       "      <td>65.0</td>\n",
       "      <td>2020/1/26</td>\n",
       "      <td>0</td>\n",
       "      <td>0</td>\n",
       "    </tr>\n",
       "  </tbody>\n",
       "</table>\n",
       "</div>"
      ],
      "text/plain": [
       "   Id Province/State Country/Region   Lat  Long       Date  ConfirmedCases  \\\n",
       "0   1            NaN    Afghanistan  33.0  65.0  2020/1/22               0   \n",
       "1   2            NaN    Afghanistan  33.0  65.0  2020/1/23               0   \n",
       "2   3            NaN    Afghanistan  33.0  65.0  2020/1/24               0   \n",
       "3   4            NaN    Afghanistan  33.0  65.0  2020/1/25               0   \n",
       "4   5            NaN    Afghanistan  33.0  65.0  2020/1/26               0   \n",
       "\n",
       "   Fatalities  \n",
       "0           0  \n",
       "1           0  \n",
       "2           0  \n",
       "3           0  \n",
       "4           0  "
      ]
     },
     "execution_count": 6,
     "metadata": {},
     "output_type": "execute_result"
    }
   ],
   "source": [
    "df_train.head() #####训练集数据"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 7,
   "metadata": {},
   "outputs": [
    {
     "data": {
      "text/html": [
       "<div>\n",
       "<style scoped>\n",
       "    .dataframe tbody tr th:only-of-type {\n",
       "        vertical-align: middle;\n",
       "    }\n",
       "\n",
       "    .dataframe tbody tr th {\n",
       "        vertical-align: top;\n",
       "    }\n",
       "\n",
       "    .dataframe thead th {\n",
       "        text-align: right;\n",
       "    }\n",
       "</style>\n",
       "<table border=\"1\" class=\"dataframe\">\n",
       "  <thead>\n",
       "    <tr style=\"text-align: right;\">\n",
       "      <th></th>\n",
       "      <th>ForecastId</th>\n",
       "      <th>Province/State</th>\n",
       "      <th>Country/Region</th>\n",
       "      <th>Lat</th>\n",
       "      <th>Long</th>\n",
       "      <th>Date</th>\n",
       "    </tr>\n",
       "  </thead>\n",
       "  <tbody>\n",
       "    <tr>\n",
       "      <th>0</th>\n",
       "      <td>1</td>\n",
       "      <td>NaN</td>\n",
       "      <td>Afghanistan</td>\n",
       "      <td>33.0</td>\n",
       "      <td>65.0</td>\n",
       "      <td>2020-03-12</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>1</th>\n",
       "      <td>2</td>\n",
       "      <td>NaN</td>\n",
       "      <td>Afghanistan</td>\n",
       "      <td>33.0</td>\n",
       "      <td>65.0</td>\n",
       "      <td>2020-03-13</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>2</th>\n",
       "      <td>3</td>\n",
       "      <td>NaN</td>\n",
       "      <td>Afghanistan</td>\n",
       "      <td>33.0</td>\n",
       "      <td>65.0</td>\n",
       "      <td>2020-03-14</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>3</th>\n",
       "      <td>4</td>\n",
       "      <td>NaN</td>\n",
       "      <td>Afghanistan</td>\n",
       "      <td>33.0</td>\n",
       "      <td>65.0</td>\n",
       "      <td>2020-03-15</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>4</th>\n",
       "      <td>5</td>\n",
       "      <td>NaN</td>\n",
       "      <td>Afghanistan</td>\n",
       "      <td>33.0</td>\n",
       "      <td>65.0</td>\n",
       "      <td>2020-03-16</td>\n",
       "    </tr>\n",
       "  </tbody>\n",
       "</table>\n",
       "</div>"
      ],
      "text/plain": [
       "   ForecastId Province/State Country/Region   Lat  Long        Date\n",
       "0           1            NaN    Afghanistan  33.0  65.0  2020-03-12\n",
       "1           2            NaN    Afghanistan  33.0  65.0  2020-03-13\n",
       "2           3            NaN    Afghanistan  33.0  65.0  2020-03-14\n",
       "3           4            NaN    Afghanistan  33.0  65.0  2020-03-15\n",
       "4           5            NaN    Afghanistan  33.0  65.0  2020-03-16"
      ]
     },
     "execution_count": 7,
     "metadata": {},
     "output_type": "execute_result"
    }
   ],
   "source": [
    "df_test.head() ######测试集数据"
   ]
  },
  {
   "cell_type": "markdown",
   "metadata": {},
   "source": [
    "--------------------------"
   ]
  },
  {
   "cell_type": "markdown",
   "metadata": {},
   "source": [
    "1.预处理部分"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 9,
   "metadata": {},
   "outputs": [],
   "source": [
    "#######不必要的数据列项规整,国家地区明显可以合并"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 10,
   "metadata": {},
   "outputs": [],
   "source": [
    "######将训练集以及测试集一起预处理"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 8,
   "metadata": {},
   "outputs": [],
   "source": [
    "df_traintest=pd.concat([df_train,df_test])"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 9,
   "metadata": {},
   "outputs": [
    {
     "data": {
      "text/plain": [
       "(30104, 9)"
      ]
     },
     "execution_count": 9,
     "metadata": {},
     "output_type": "execute_result"
    }
   ],
   "source": [
    "df_traintest.shape"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 10,
   "metadata": {},
   "outputs": [
    {
     "data": {
      "text/html": [
       "<div>\n",
       "<style scoped>\n",
       "    .dataframe tbody tr th:only-of-type {\n",
       "        vertical-align: middle;\n",
       "    }\n",
       "\n",
       "    .dataframe tbody tr th {\n",
       "        vertical-align: top;\n",
       "    }\n",
       "\n",
       "    .dataframe thead th {\n",
       "        text-align: right;\n",
       "    }\n",
       "</style>\n",
       "<table border=\"1\" class=\"dataframe\">\n",
       "  <thead>\n",
       "    <tr style=\"text-align: right;\">\n",
       "      <th></th>\n",
       "      <th>Id</th>\n",
       "      <th>Province/State</th>\n",
       "      <th>Country/Region</th>\n",
       "      <th>Lat</th>\n",
       "      <th>Long</th>\n",
       "      <th>Date</th>\n",
       "      <th>ConfirmedCases</th>\n",
       "      <th>Fatalities</th>\n",
       "      <th>ForecastId</th>\n",
       "    </tr>\n",
       "  </thead>\n",
       "  <tbody>\n",
       "    <tr>\n",
       "      <th>0</th>\n",
       "      <td>1.0</td>\n",
       "      <td>NaN</td>\n",
       "      <td>Afghanistan</td>\n",
       "      <td>33.0</td>\n",
       "      <td>65.0</td>\n",
       "      <td>2020/1/22</td>\n",
       "      <td>0.0</td>\n",
       "      <td>0.0</td>\n",
       "      <td>NaN</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>1</th>\n",
       "      <td>2.0</td>\n",
       "      <td>NaN</td>\n",
       "      <td>Afghanistan</td>\n",
       "      <td>33.0</td>\n",
       "      <td>65.0</td>\n",
       "      <td>2020/1/23</td>\n",
       "      <td>0.0</td>\n",
       "      <td>0.0</td>\n",
       "      <td>NaN</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>2</th>\n",
       "      <td>3.0</td>\n",
       "      <td>NaN</td>\n",
       "      <td>Afghanistan</td>\n",
       "      <td>33.0</td>\n",
       "      <td>65.0</td>\n",
       "      <td>2020/1/24</td>\n",
       "      <td>0.0</td>\n",
       "      <td>0.0</td>\n",
       "      <td>NaN</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>3</th>\n",
       "      <td>4.0</td>\n",
       "      <td>NaN</td>\n",
       "      <td>Afghanistan</td>\n",
       "      <td>33.0</td>\n",
       "      <td>65.0</td>\n",
       "      <td>2020/1/25</td>\n",
       "      <td>0.0</td>\n",
       "      <td>0.0</td>\n",
       "      <td>NaN</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>4</th>\n",
       "      <td>5.0</td>\n",
       "      <td>NaN</td>\n",
       "      <td>Afghanistan</td>\n",
       "      <td>33.0</td>\n",
       "      <td>65.0</td>\n",
       "      <td>2020/1/26</td>\n",
       "      <td>0.0</td>\n",
       "      <td>0.0</td>\n",
       "      <td>NaN</td>\n",
       "    </tr>\n",
       "  </tbody>\n",
       "</table>\n",
       "</div>"
      ],
      "text/plain": [
       "    Id Province/State Country/Region   Lat  Long       Date  ConfirmedCases  \\\n",
       "0  1.0            NaN    Afghanistan  33.0  65.0  2020/1/22             0.0   \n",
       "1  2.0            NaN    Afghanistan  33.0  65.0  2020/1/23             0.0   \n",
       "2  3.0            NaN    Afghanistan  33.0  65.0  2020/1/24             0.0   \n",
       "3  4.0            NaN    Afghanistan  33.0  65.0  2020/1/25             0.0   \n",
       "4  5.0            NaN    Afghanistan  33.0  65.0  2020/1/26             0.0   \n",
       "\n",
       "   Fatalities  ForecastId  \n",
       "0         0.0         NaN  \n",
       "1         0.0         NaN  \n",
       "2         0.0         NaN  \n",
       "3         0.0         NaN  \n",
       "4         0.0         NaN  "
      ]
     },
     "execution_count": 10,
     "metadata": {},
     "output_type": "execute_result"
    }
   ],
   "source": [
    "df_traintest.head()"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 23,
   "metadata": {},
   "outputs": [
    {
     "data": {
      "text/html": [
       "<div>\n",
       "<style scoped>\n",
       "    .dataframe tbody tr th:only-of-type {\n",
       "        vertical-align: middle;\n",
       "    }\n",
       "\n",
       "    .dataframe tbody tr th {\n",
       "        vertical-align: top;\n",
       "    }\n",
       "\n",
       "    .dataframe thead th {\n",
       "        text-align: right;\n",
       "    }\n",
       "</style>\n",
       "<table border=\"1\" class=\"dataframe\">\n",
       "  <thead>\n",
       "    <tr style=\"text-align: right;\">\n",
       "      <th></th>\n",
       "      <th>Id</th>\n",
       "      <th>Province/State</th>\n",
       "      <th>Country/Region</th>\n",
       "      <th>Lat</th>\n",
       "      <th>Long</th>\n",
       "      <th>Date</th>\n",
       "      <th>ConfirmedCases</th>\n",
       "      <th>Fatalities</th>\n",
       "    </tr>\n",
       "  </thead>\n",
       "  <tbody>\n",
       "    <tr>\n",
       "      <th>0</th>\n",
       "      <td>1</td>\n",
       "      <td>NaN</td>\n",
       "      <td>Afghanistan</td>\n",
       "      <td>33.0</td>\n",
       "      <td>65.0</td>\n",
       "      <td>2020/1/22</td>\n",
       "      <td>0</td>\n",
       "      <td>0</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>1</th>\n",
       "      <td>2</td>\n",
       "      <td>NaN</td>\n",
       "      <td>Afghanistan</td>\n",
       "      <td>33.0</td>\n",
       "      <td>65.0</td>\n",
       "      <td>2020/1/23</td>\n",
       "      <td>0</td>\n",
       "      <td>0</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>2</th>\n",
       "      <td>3</td>\n",
       "      <td>NaN</td>\n",
       "      <td>Afghanistan</td>\n",
       "      <td>33.0</td>\n",
       "      <td>65.0</td>\n",
       "      <td>2020/1/24</td>\n",
       "      <td>0</td>\n",
       "      <td>0</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>3</th>\n",
       "      <td>4</td>\n",
       "      <td>NaN</td>\n",
       "      <td>Afghanistan</td>\n",
       "      <td>33.0</td>\n",
       "      <td>65.0</td>\n",
       "      <td>2020/1/25</td>\n",
       "      <td>0</td>\n",
       "      <td>0</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>4</th>\n",
       "      <td>5</td>\n",
       "      <td>NaN</td>\n",
       "      <td>Afghanistan</td>\n",
       "      <td>33.0</td>\n",
       "      <td>65.0</td>\n",
       "      <td>2020/1/26</td>\n",
       "      <td>0</td>\n",
       "      <td>0</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>...</th>\n",
       "      <td>...</td>\n",
       "      <td>...</td>\n",
       "      <td>...</td>\n",
       "      <td>...</td>\n",
       "      <td>...</td>\n",
       "      <td>...</td>\n",
       "      <td>...</td>\n",
       "      <td>...</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>58</th>\n",
       "      <td>59</td>\n",
       "      <td>NaN</td>\n",
       "      <td>Afghanistan</td>\n",
       "      <td>33.0</td>\n",
       "      <td>65.0</td>\n",
       "      <td>2020/3/20</td>\n",
       "      <td>24</td>\n",
       "      <td>0</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>59</th>\n",
       "      <td>60</td>\n",
       "      <td>NaN</td>\n",
       "      <td>Afghanistan</td>\n",
       "      <td>33.0</td>\n",
       "      <td>65.0</td>\n",
       "      <td>2020/3/21</td>\n",
       "      <td>24</td>\n",
       "      <td>0</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>60</th>\n",
       "      <td>61</td>\n",
       "      <td>NaN</td>\n",
       "      <td>Afghanistan</td>\n",
       "      <td>33.0</td>\n",
       "      <td>65.0</td>\n",
       "      <td>2020/3/22</td>\n",
       "      <td>40</td>\n",
       "      <td>1</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>61</th>\n",
       "      <td>62</td>\n",
       "      <td>NaN</td>\n",
       "      <td>Afghanistan</td>\n",
       "      <td>33.0</td>\n",
       "      <td>65.0</td>\n",
       "      <td>2020/3/23</td>\n",
       "      <td>40</td>\n",
       "      <td>1</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>62</th>\n",
       "      <td>63</td>\n",
       "      <td>NaN</td>\n",
       "      <td>Afghanistan</td>\n",
       "      <td>33.0</td>\n",
       "      <td>65.0</td>\n",
       "      <td>2020/3/24</td>\n",
       "      <td>74</td>\n",
       "      <td>1</td>\n",
       "    </tr>\n",
       "  </tbody>\n",
       "</table>\n",
       "<p>63 rows × 8 columns</p>\n",
       "</div>"
      ],
      "text/plain": [
       "    Id Province/State Country/Region   Lat  Long       Date  ConfirmedCases  \\\n",
       "0    1            NaN    Afghanistan  33.0  65.0  2020/1/22               0   \n",
       "1    2            NaN    Afghanistan  33.0  65.0  2020/1/23               0   \n",
       "2    3            NaN    Afghanistan  33.0  65.0  2020/1/24               0   \n",
       "3    4            NaN    Afghanistan  33.0  65.0  2020/1/25               0   \n",
       "4    5            NaN    Afghanistan  33.0  65.0  2020/1/26               0   \n",
       "..  ..            ...            ...   ...   ...        ...             ...   \n",
       "58  59            NaN    Afghanistan  33.0  65.0  2020/3/20              24   \n",
       "59  60            NaN    Afghanistan  33.0  65.0  2020/3/21              24   \n",
       "60  61            NaN    Afghanistan  33.0  65.0  2020/3/22              40   \n",
       "61  62            NaN    Afghanistan  33.0  65.0  2020/3/23              40   \n",
       "62  63            NaN    Afghanistan  33.0  65.0  2020/3/24              74   \n",
       "\n",
       "    Fatalities  \n",
       "0            0  \n",
       "1            0  \n",
       "2            0  \n",
       "3            0  \n",
       "4            0  \n",
       "..         ...  \n",
       "58           0  \n",
       "59           0  \n",
       "60           1  \n",
       "61           1  \n",
       "62           1  \n",
       "\n",
       "[63 rows x 8 columns]"
      ]
     },
     "execution_count": 23,
     "metadata": {},
     "output_type": "execute_result"
    }
   ],
   "source": [
    "df_train[df_train[\"Country/Region\"]==\"Afghanistan\"]                   ##########我们的训练数据一直到3月24号"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 14,
   "metadata": {},
   "outputs": [],
   "source": [
    "#######很明显这个ID就是个不可能有用的数据"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 27,
   "metadata": {},
   "outputs": [],
   "source": [
    "def func(x):\n",
    "    try:\n",
    "        x_new=x[\"Country/Region\"]+\"/\"+x[\"Province/State\"]\n",
    "    except:\n",
    "        x_new=x[\"Country/Region\"] \n",
    "    return str(x_new)             \n",
    "#####################这一步代码很重要\n",
    "####################需要转换类型要不之后无法比较"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 28,
   "metadata": {},
   "outputs": [],
   "source": [
    "df_traintest[\"place_id\"]=df_traintest.apply(lambda x:func(x),axis=1)"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 29,
   "metadata": {},
   "outputs": [
    {
     "data": {
      "text/html": [
       "<div>\n",
       "<style scoped>\n",
       "    .dataframe tbody tr th:only-of-type {\n",
       "        vertical-align: middle;\n",
       "    }\n",
       "\n",
       "    .dataframe tbody tr th {\n",
       "        vertical-align: top;\n",
       "    }\n",
       "\n",
       "    .dataframe thead th {\n",
       "        text-align: right;\n",
       "    }\n",
       "</style>\n",
       "<table border=\"1\" class=\"dataframe\">\n",
       "  <thead>\n",
       "    <tr style=\"text-align: right;\">\n",
       "      <th></th>\n",
       "      <th>Id</th>\n",
       "      <th>Province/State</th>\n",
       "      <th>Country/Region</th>\n",
       "      <th>Lat</th>\n",
       "      <th>Long</th>\n",
       "      <th>Date</th>\n",
       "      <th>ConfirmedCases</th>\n",
       "      <th>Fatalities</th>\n",
       "      <th>ForecastId</th>\n",
       "      <th>place_id</th>\n",
       "      <th>day</th>\n",
       "    </tr>\n",
       "  </thead>\n",
       "  <tbody>\n",
       "    <tr>\n",
       "      <th>888</th>\n",
       "      <td>1309.0</td>\n",
       "      <td>Tasmania</td>\n",
       "      <td>Australia</td>\n",
       "      <td>-41.4545</td>\n",
       "      <td>145.9707</td>\n",
       "      <td>2020-01-28</td>\n",
       "      <td>0.0</td>\n",
       "      <td>0.0</td>\n",
       "      <td>NaN</td>\n",
       "      <td>Australia/Tasmania</td>\n",
       "      <td>28</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>889</th>\n",
       "      <td>1310.0</td>\n",
       "      <td>Tasmania</td>\n",
       "      <td>Australia</td>\n",
       "      <td>-41.4545</td>\n",
       "      <td>145.9707</td>\n",
       "      <td>2020-01-29</td>\n",
       "      <td>0.0</td>\n",
       "      <td>0.0</td>\n",
       "      <td>NaN</td>\n",
       "      <td>Australia/Tasmania</td>\n",
       "      <td>29</td>\n",
       "    </tr>\n",
       "  </tbody>\n",
       "</table>\n",
       "</div>"
      ],
      "text/plain": [
       "         Id Province/State Country/Region      Lat      Long       Date  \\\n",
       "888  1309.0       Tasmania      Australia -41.4545  145.9707 2020-01-28   \n",
       "889  1310.0       Tasmania      Australia -41.4545  145.9707 2020-01-29   \n",
       "\n",
       "     ConfirmedCases  Fatalities  ForecastId            place_id  day  \n",
       "888             0.0         0.0         NaN  Australia/Tasmania   28  \n",
       "889             0.0         0.0         NaN  Australia/Tasmania   29  "
      ]
     },
     "execution_count": 29,
     "metadata": {},
     "output_type": "execute_result"
    }
   ],
   "source": [
    "df_traintest[888:890]     ################成功生成了国家和城市的id"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 30,
   "metadata": {},
   "outputs": [],
   "source": [
    "tmp=np.sort(df_traintest[\"place_id\"].unique())"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 31,
   "metadata": {},
   "outputs": [
    {
     "name": "stdout",
     "output_type": "stream",
     "text": [
      "一共有284个地区的调查数据\n",
      "['Afghanistan' 'Albania' 'Algeria' 'Andorra' 'Antigua and Barbuda'\n",
      " 'Argentina' 'Armenia' 'Aruba' 'Australia/Australian Capital Territory'\n",
      " 'Australia/From Diamond Princess']\n"
     ]
    }
   ],
   "source": [
    "print(\"一共有{}个地区的调查数据\".format(len(tmp)))  \n",
    "print(tmp[:10])"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 32,
   "metadata": {},
   "outputs": [],
   "source": [
    "###############这个日期数据不是很友好，转化一下数据类型"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 40,
   "metadata": {},
   "outputs": [],
   "source": [
    "df_traintest[\"Date\"]=pd.to_datetime(df_traintest[\"Date\"])          ###############将天的数据转换"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 41,
   "metadata": {},
   "outputs": [
    {
     "data": {
      "text/html": [
       "<div>\n",
       "<style scoped>\n",
       "    .dataframe tbody tr th:only-of-type {\n",
       "        vertical-align: middle;\n",
       "    }\n",
       "\n",
       "    .dataframe tbody tr th {\n",
       "        vertical-align: top;\n",
       "    }\n",
       "\n",
       "    .dataframe thead th {\n",
       "        text-align: right;\n",
       "    }\n",
       "</style>\n",
       "<table border=\"1\" class=\"dataframe\">\n",
       "  <thead>\n",
       "    <tr style=\"text-align: right;\">\n",
       "      <th></th>\n",
       "      <th>Id</th>\n",
       "      <th>Province/State</th>\n",
       "      <th>Country/Region</th>\n",
       "      <th>Lat</th>\n",
       "      <th>Long</th>\n",
       "      <th>Date</th>\n",
       "      <th>ConfirmedCases</th>\n",
       "      <th>Fatalities</th>\n",
       "      <th>ForecastId</th>\n",
       "      <th>place_id</th>\n",
       "      <th>day</th>\n",
       "    </tr>\n",
       "  </thead>\n",
       "  <tbody>\n",
       "    <tr>\n",
       "      <th>0</th>\n",
       "      <td>1.0</td>\n",
       "      <td>NaN</td>\n",
       "      <td>Afghanistan</td>\n",
       "      <td>33.0</td>\n",
       "      <td>65.0</td>\n",
       "      <td>2020-01-22</td>\n",
       "      <td>0.0</td>\n",
       "      <td>0.0</td>\n",
       "      <td>NaN</td>\n",
       "      <td>Afghanistan</td>\n",
       "      <td>22</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>1</th>\n",
       "      <td>2.0</td>\n",
       "      <td>NaN</td>\n",
       "      <td>Afghanistan</td>\n",
       "      <td>33.0</td>\n",
       "      <td>65.0</td>\n",
       "      <td>2020-01-23</td>\n",
       "      <td>0.0</td>\n",
       "      <td>0.0</td>\n",
       "      <td>NaN</td>\n",
       "      <td>Afghanistan</td>\n",
       "      <td>23</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>2</th>\n",
       "      <td>3.0</td>\n",
       "      <td>NaN</td>\n",
       "      <td>Afghanistan</td>\n",
       "      <td>33.0</td>\n",
       "      <td>65.0</td>\n",
       "      <td>2020-01-24</td>\n",
       "      <td>0.0</td>\n",
       "      <td>0.0</td>\n",
       "      <td>NaN</td>\n",
       "      <td>Afghanistan</td>\n",
       "      <td>24</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>3</th>\n",
       "      <td>4.0</td>\n",
       "      <td>NaN</td>\n",
       "      <td>Afghanistan</td>\n",
       "      <td>33.0</td>\n",
       "      <td>65.0</td>\n",
       "      <td>2020-01-25</td>\n",
       "      <td>0.0</td>\n",
       "      <td>0.0</td>\n",
       "      <td>NaN</td>\n",
       "      <td>Afghanistan</td>\n",
       "      <td>25</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>4</th>\n",
       "      <td>5.0</td>\n",
       "      <td>NaN</td>\n",
       "      <td>Afghanistan</td>\n",
       "      <td>33.0</td>\n",
       "      <td>65.0</td>\n",
       "      <td>2020-01-26</td>\n",
       "      <td>0.0</td>\n",
       "      <td>0.0</td>\n",
       "      <td>NaN</td>\n",
       "      <td>Afghanistan</td>\n",
       "      <td>26</td>\n",
       "    </tr>\n",
       "  </tbody>\n",
       "</table>\n",
       "</div>"
      ],
      "text/plain": [
       "    Id Province/State Country/Region   Lat  Long       Date  ConfirmedCases  \\\n",
       "0  1.0            NaN    Afghanistan  33.0  65.0 2020-01-22             0.0   \n",
       "1  2.0            NaN    Afghanistan  33.0  65.0 2020-01-23             0.0   \n",
       "2  3.0            NaN    Afghanistan  33.0  65.0 2020-01-24             0.0   \n",
       "3  4.0            NaN    Afghanistan  33.0  65.0 2020-01-25             0.0   \n",
       "4  5.0            NaN    Afghanistan  33.0  65.0 2020-01-26             0.0   \n",
       "\n",
       "   Fatalities  ForecastId     place_id  day  \n",
       "0         0.0         NaN  Afghanistan   22  \n",
       "1         0.0         NaN  Afghanistan   23  \n",
       "2         0.0         NaN  Afghanistan   24  \n",
       "3         0.0         NaN  Afghanistan   25  \n",
       "4         0.0         NaN  Afghanistan   26  "
      ]
     },
     "execution_count": 41,
     "metadata": {},
     "output_type": "execute_result"
    }
   ],
   "source": [
    "df_traintest.head()                  ################################训练测试集"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 23,
   "metadata": {},
   "outputs": [],
   "source": [
    "####################插入关于天的数据"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 42,
   "metadata": {},
   "outputs": [
    {
     "data": {
      "text/html": [
       "<div>\n",
       "<style scoped>\n",
       "    .dataframe tbody tr th:only-of-type {\n",
       "        vertical-align: middle;\n",
       "    }\n",
       "\n",
       "    .dataframe tbody tr th {\n",
       "        vertical-align: top;\n",
       "    }\n",
       "\n",
       "    .dataframe thead th {\n",
       "        text-align: right;\n",
       "    }\n",
       "</style>\n",
       "<table border=\"1\" class=\"dataframe\">\n",
       "  <thead>\n",
       "    <tr style=\"text-align: right;\">\n",
       "      <th></th>\n",
       "      <th>Id</th>\n",
       "      <th>Province/State</th>\n",
       "      <th>Country/Region</th>\n",
       "      <th>Lat</th>\n",
       "      <th>Long</th>\n",
       "      <th>Date</th>\n",
       "      <th>ConfirmedCases</th>\n",
       "      <th>Fatalities</th>\n",
       "      <th>ForecastId</th>\n",
       "      <th>place_id</th>\n",
       "      <th>day</th>\n",
       "    </tr>\n",
       "  </thead>\n",
       "  <tbody>\n",
       "    <tr>\n",
       "      <th>0</th>\n",
       "      <td>1.0</td>\n",
       "      <td>NaN</td>\n",
       "      <td>Afghanistan</td>\n",
       "      <td>33.0</td>\n",
       "      <td>65.0</td>\n",
       "      <td>2020-01-22</td>\n",
       "      <td>0.0</td>\n",
       "      <td>0.0</td>\n",
       "      <td>NaN</td>\n",
       "      <td>Afghanistan</td>\n",
       "      <td>22</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>1</th>\n",
       "      <td>2.0</td>\n",
       "      <td>NaN</td>\n",
       "      <td>Afghanistan</td>\n",
       "      <td>33.0</td>\n",
       "      <td>65.0</td>\n",
       "      <td>2020-01-23</td>\n",
       "      <td>0.0</td>\n",
       "      <td>0.0</td>\n",
       "      <td>NaN</td>\n",
       "      <td>Afghanistan</td>\n",
       "      <td>23</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>2</th>\n",
       "      <td>3.0</td>\n",
       "      <td>NaN</td>\n",
       "      <td>Afghanistan</td>\n",
       "      <td>33.0</td>\n",
       "      <td>65.0</td>\n",
       "      <td>2020-01-24</td>\n",
       "      <td>0.0</td>\n",
       "      <td>0.0</td>\n",
       "      <td>NaN</td>\n",
       "      <td>Afghanistan</td>\n",
       "      <td>24</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>3</th>\n",
       "      <td>4.0</td>\n",
       "      <td>NaN</td>\n",
       "      <td>Afghanistan</td>\n",
       "      <td>33.0</td>\n",
       "      <td>65.0</td>\n",
       "      <td>2020-01-25</td>\n",
       "      <td>0.0</td>\n",
       "      <td>0.0</td>\n",
       "      <td>NaN</td>\n",
       "      <td>Afghanistan</td>\n",
       "      <td>25</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>4</th>\n",
       "      <td>5.0</td>\n",
       "      <td>NaN</td>\n",
       "      <td>Afghanistan</td>\n",
       "      <td>33.0</td>\n",
       "      <td>65.0</td>\n",
       "      <td>2020-01-26</td>\n",
       "      <td>0.0</td>\n",
       "      <td>0.0</td>\n",
       "      <td>NaN</td>\n",
       "      <td>Afghanistan</td>\n",
       "      <td>26</td>\n",
       "    </tr>\n",
       "  </tbody>\n",
       "</table>\n",
       "</div>"
      ],
      "text/plain": [
       "    Id Province/State Country/Region   Lat  Long       Date  ConfirmedCases  \\\n",
       "0  1.0            NaN    Afghanistan  33.0  65.0 2020-01-22             0.0   \n",
       "1  2.0            NaN    Afghanistan  33.0  65.0 2020-01-23             0.0   \n",
       "2  3.0            NaN    Afghanistan  33.0  65.0 2020-01-24             0.0   \n",
       "3  4.0            NaN    Afghanistan  33.0  65.0 2020-01-25             0.0   \n",
       "4  5.0            NaN    Afghanistan  33.0  65.0 2020-01-26             0.0   \n",
       "\n",
       "   Fatalities  ForecastId     place_id  day  \n",
       "0         0.0         NaN  Afghanistan   22  \n",
       "1         0.0         NaN  Afghanistan   23  \n",
       "2         0.0         NaN  Afghanistan   24  \n",
       "3         0.0         NaN  Afghanistan   25  \n",
       "4         0.0         NaN  Afghanistan   26  "
      ]
     },
     "execution_count": 42,
     "metadata": {},
     "output_type": "execute_result"
    }
   ],
   "source": [
    "df_traintest[\"day\"]=df_traintest[\"Date\"].apply(lambda x: x.dayofyear).astype(np.int16)\n",
    "df_traintest.head()                     ##########################将日期排序"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 43,
   "metadata": {},
   "outputs": [
    {
     "data": {
      "text/html": [
       "<div>\n",
       "<style scoped>\n",
       "    .dataframe tbody tr th:only-of-type {\n",
       "        vertical-align: middle;\n",
       "    }\n",
       "\n",
       "    .dataframe tbody tr th {\n",
       "        vertical-align: top;\n",
       "    }\n",
       "\n",
       "    .dataframe thead th {\n",
       "        text-align: right;\n",
       "    }\n",
       "</style>\n",
       "<table border=\"1\" class=\"dataframe\">\n",
       "  <thead>\n",
       "    <tr style=\"text-align: right;\">\n",
       "      <th></th>\n",
       "      <th>Id</th>\n",
       "      <th>Province/State</th>\n",
       "      <th>Country/Region</th>\n",
       "      <th>Lat</th>\n",
       "      <th>Long</th>\n",
       "      <th>Date</th>\n",
       "      <th>ConfirmedCases</th>\n",
       "      <th>Fatalities</th>\n",
       "      <th>ForecastId</th>\n",
       "      <th>place_id</th>\n",
       "      <th>day</th>\n",
       "    </tr>\n",
       "  </thead>\n",
       "  <tbody>\n",
       "    <tr>\n",
       "      <th>0</th>\n",
       "      <td>1.0</td>\n",
       "      <td>NaN</td>\n",
       "      <td>Afghanistan</td>\n",
       "      <td>33.0000</td>\n",
       "      <td>65.0000</td>\n",
       "      <td>2020-01-22</td>\n",
       "      <td>0.0</td>\n",
       "      <td>0.0</td>\n",
       "      <td>NaN</td>\n",
       "      <td>Afghanistan</td>\n",
       "      <td>22</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>1</th>\n",
       "      <td>2.0</td>\n",
       "      <td>NaN</td>\n",
       "      <td>Afghanistan</td>\n",
       "      <td>33.0000</td>\n",
       "      <td>65.0000</td>\n",
       "      <td>2020-01-23</td>\n",
       "      <td>0.0</td>\n",
       "      <td>0.0</td>\n",
       "      <td>NaN</td>\n",
       "      <td>Afghanistan</td>\n",
       "      <td>23</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>2</th>\n",
       "      <td>3.0</td>\n",
       "      <td>NaN</td>\n",
       "      <td>Afghanistan</td>\n",
       "      <td>33.0000</td>\n",
       "      <td>65.0000</td>\n",
       "      <td>2020-01-24</td>\n",
       "      <td>0.0</td>\n",
       "      <td>0.0</td>\n",
       "      <td>NaN</td>\n",
       "      <td>Afghanistan</td>\n",
       "      <td>24</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>3</th>\n",
       "      <td>4.0</td>\n",
       "      <td>NaN</td>\n",
       "      <td>Afghanistan</td>\n",
       "      <td>33.0000</td>\n",
       "      <td>65.0000</td>\n",
       "      <td>2020-01-25</td>\n",
       "      <td>0.0</td>\n",
       "      <td>0.0</td>\n",
       "      <td>NaN</td>\n",
       "      <td>Afghanistan</td>\n",
       "      <td>25</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>4</th>\n",
       "      <td>5.0</td>\n",
       "      <td>NaN</td>\n",
       "      <td>Afghanistan</td>\n",
       "      <td>33.0000</td>\n",
       "      <td>65.0000</td>\n",
       "      <td>2020-01-26</td>\n",
       "      <td>0.0</td>\n",
       "      <td>0.0</td>\n",
       "      <td>NaN</td>\n",
       "      <td>Afghanistan</td>\n",
       "      <td>26</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>...</th>\n",
       "      <td>...</td>\n",
       "      <td>...</td>\n",
       "      <td>...</td>\n",
       "      <td>...</td>\n",
       "      <td>...</td>\n",
       "      <td>...</td>\n",
       "      <td>...</td>\n",
       "      <td>...</td>\n",
       "      <td>...</td>\n",
       "      <td>...</td>\n",
       "      <td>...</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>12197</th>\n",
       "      <td>NaN</td>\n",
       "      <td>NaN</td>\n",
       "      <td>Zambia</td>\n",
       "      <td>-15.4167</td>\n",
       "      <td>28.2833</td>\n",
       "      <td>2020-04-09</td>\n",
       "      <td>NaN</td>\n",
       "      <td>NaN</td>\n",
       "      <td>12198.0</td>\n",
       "      <td>Zambia</td>\n",
       "      <td>100</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>12198</th>\n",
       "      <td>NaN</td>\n",
       "      <td>NaN</td>\n",
       "      <td>Zambia</td>\n",
       "      <td>-15.4167</td>\n",
       "      <td>28.2833</td>\n",
       "      <td>2020-04-10</td>\n",
       "      <td>NaN</td>\n",
       "      <td>NaN</td>\n",
       "      <td>12199.0</td>\n",
       "      <td>Zambia</td>\n",
       "      <td>101</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>12199</th>\n",
       "      <td>NaN</td>\n",
       "      <td>NaN</td>\n",
       "      <td>Zambia</td>\n",
       "      <td>-15.4167</td>\n",
       "      <td>28.2833</td>\n",
       "      <td>2020-04-11</td>\n",
       "      <td>NaN</td>\n",
       "      <td>NaN</td>\n",
       "      <td>12200.0</td>\n",
       "      <td>Zambia</td>\n",
       "      <td>102</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>12200</th>\n",
       "      <td>NaN</td>\n",
       "      <td>NaN</td>\n",
       "      <td>Zambia</td>\n",
       "      <td>-15.4167</td>\n",
       "      <td>28.2833</td>\n",
       "      <td>2020-04-12</td>\n",
       "      <td>NaN</td>\n",
       "      <td>NaN</td>\n",
       "      <td>12201.0</td>\n",
       "      <td>Zambia</td>\n",
       "      <td>103</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>12201</th>\n",
       "      <td>NaN</td>\n",
       "      <td>NaN</td>\n",
       "      <td>Zambia</td>\n",
       "      <td>-15.4167</td>\n",
       "      <td>28.2833</td>\n",
       "      <td>2020-04-13</td>\n",
       "      <td>NaN</td>\n",
       "      <td>NaN</td>\n",
       "      <td>12202.0</td>\n",
       "      <td>Zambia</td>\n",
       "      <td>104</td>\n",
       "    </tr>\n",
       "  </tbody>\n",
       "</table>\n",
       "<p>30094 rows × 11 columns</p>\n",
       "</div>"
      ],
      "text/plain": [
       "        Id Province/State Country/Region      Lat     Long       Date  \\\n",
       "0      1.0            NaN    Afghanistan  33.0000  65.0000 2020-01-22   \n",
       "1      2.0            NaN    Afghanistan  33.0000  65.0000 2020-01-23   \n",
       "2      3.0            NaN    Afghanistan  33.0000  65.0000 2020-01-24   \n",
       "3      4.0            NaN    Afghanistan  33.0000  65.0000 2020-01-25   \n",
       "4      5.0            NaN    Afghanistan  33.0000  65.0000 2020-01-26   \n",
       "...    ...            ...            ...      ...      ...        ...   \n",
       "12197  NaN            NaN         Zambia -15.4167  28.2833 2020-04-09   \n",
       "12198  NaN            NaN         Zambia -15.4167  28.2833 2020-04-10   \n",
       "12199  NaN            NaN         Zambia -15.4167  28.2833 2020-04-11   \n",
       "12200  NaN            NaN         Zambia -15.4167  28.2833 2020-04-12   \n",
       "12201  NaN            NaN         Zambia -15.4167  28.2833 2020-04-13   \n",
       "\n",
       "       ConfirmedCases  Fatalities  ForecastId     place_id  day  \n",
       "0                 0.0         0.0         NaN  Afghanistan   22  \n",
       "1                 0.0         0.0         NaN  Afghanistan   23  \n",
       "2                 0.0         0.0         NaN  Afghanistan   24  \n",
       "3                 0.0         0.0         NaN  Afghanistan   25  \n",
       "4                 0.0         0.0         NaN  Afghanistan   26  \n",
       "...               ...         ...         ...          ...  ...  \n",
       "12197             NaN         NaN     12198.0       Zambia  100  \n",
       "12198             NaN         NaN     12199.0       Zambia  101  \n",
       "12199             NaN         NaN     12200.0       Zambia  102  \n",
       "12200             NaN         NaN     12201.0       Zambia  103  \n",
       "12201             NaN         NaN     12202.0       Zambia  104  \n",
       "\n",
       "[30094 rows x 11 columns]"
      ]
     },
     "execution_count": 43,
     "metadata": {},
     "output_type": "execute_result"
    }
   ],
   "source": [
    "df_traintest[:-10]    ######################排在后面没有确诊死亡数目的都是测试数据          "
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 44,
   "metadata": {},
   "outputs": [
    {
     "data": {
      "text/html": [
       "<div>\n",
       "<style scoped>\n",
       "    .dataframe tbody tr th:only-of-type {\n",
       "        vertical-align: middle;\n",
       "    }\n",
       "\n",
       "    .dataframe tbody tr th {\n",
       "        vertical-align: top;\n",
       "    }\n",
       "\n",
       "    .dataframe thead th {\n",
       "        text-align: right;\n",
       "    }\n",
       "</style>\n",
       "<table border=\"1\" class=\"dataframe\">\n",
       "  <thead>\n",
       "    <tr style=\"text-align: right;\">\n",
       "      <th></th>\n",
       "      <th>Id</th>\n",
       "      <th>Province/State</th>\n",
       "      <th>Country/Region</th>\n",
       "      <th>Lat</th>\n",
       "      <th>Long</th>\n",
       "      <th>Date</th>\n",
       "      <th>ConfirmedCases</th>\n",
       "      <th>Fatalities</th>\n",
       "      <th>ForecastId</th>\n",
       "      <th>place_id</th>\n",
       "      <th>day</th>\n",
       "    </tr>\n",
       "  </thead>\n",
       "  <tbody>\n",
       "    <tr>\n",
       "      <th>0</th>\n",
       "      <td>1.0</td>\n",
       "      <td>NaN</td>\n",
       "      <td>Afghanistan</td>\n",
       "      <td>33.0</td>\n",
       "      <td>65.0</td>\n",
       "      <td>2020-01-22</td>\n",
       "      <td>0.0</td>\n",
       "      <td>0.0</td>\n",
       "      <td>NaN</td>\n",
       "      <td>Afghanistan</td>\n",
       "      <td>22</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>1</th>\n",
       "      <td>2.0</td>\n",
       "      <td>NaN</td>\n",
       "      <td>Afghanistan</td>\n",
       "      <td>33.0</td>\n",
       "      <td>65.0</td>\n",
       "      <td>2020-01-23</td>\n",
       "      <td>0.0</td>\n",
       "      <td>0.0</td>\n",
       "      <td>NaN</td>\n",
       "      <td>Afghanistan</td>\n",
       "      <td>23</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>2</th>\n",
       "      <td>3.0</td>\n",
       "      <td>NaN</td>\n",
       "      <td>Afghanistan</td>\n",
       "      <td>33.0</td>\n",
       "      <td>65.0</td>\n",
       "      <td>2020-01-24</td>\n",
       "      <td>0.0</td>\n",
       "      <td>0.0</td>\n",
       "      <td>NaN</td>\n",
       "      <td>Afghanistan</td>\n",
       "      <td>24</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>3</th>\n",
       "      <td>4.0</td>\n",
       "      <td>NaN</td>\n",
       "      <td>Afghanistan</td>\n",
       "      <td>33.0</td>\n",
       "      <td>65.0</td>\n",
       "      <td>2020-01-25</td>\n",
       "      <td>0.0</td>\n",
       "      <td>0.0</td>\n",
       "      <td>NaN</td>\n",
       "      <td>Afghanistan</td>\n",
       "      <td>25</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>4</th>\n",
       "      <td>5.0</td>\n",
       "      <td>NaN</td>\n",
       "      <td>Afghanistan</td>\n",
       "      <td>33.0</td>\n",
       "      <td>65.0</td>\n",
       "      <td>2020-01-26</td>\n",
       "      <td>0.0</td>\n",
       "      <td>0.0</td>\n",
       "      <td>NaN</td>\n",
       "      <td>Afghanistan</td>\n",
       "      <td>26</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>...</th>\n",
       "      <td>...</td>\n",
       "      <td>...</td>\n",
       "      <td>...</td>\n",
       "      <td>...</td>\n",
       "      <td>...</td>\n",
       "      <td>...</td>\n",
       "      <td>...</td>\n",
       "      <td>...</td>\n",
       "      <td>...</td>\n",
       "      <td>...</td>\n",
       "      <td>...</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>38</th>\n",
       "      <td>NaN</td>\n",
       "      <td>NaN</td>\n",
       "      <td>Afghanistan</td>\n",
       "      <td>33.0</td>\n",
       "      <td>65.0</td>\n",
       "      <td>2020-04-19</td>\n",
       "      <td>NaN</td>\n",
       "      <td>NaN</td>\n",
       "      <td>39.0</td>\n",
       "      <td>Afghanistan</td>\n",
       "      <td>110</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>39</th>\n",
       "      <td>NaN</td>\n",
       "      <td>NaN</td>\n",
       "      <td>Afghanistan</td>\n",
       "      <td>33.0</td>\n",
       "      <td>65.0</td>\n",
       "      <td>2020-04-20</td>\n",
       "      <td>NaN</td>\n",
       "      <td>NaN</td>\n",
       "      <td>40.0</td>\n",
       "      <td>Afghanistan</td>\n",
       "      <td>111</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>40</th>\n",
       "      <td>NaN</td>\n",
       "      <td>NaN</td>\n",
       "      <td>Afghanistan</td>\n",
       "      <td>33.0</td>\n",
       "      <td>65.0</td>\n",
       "      <td>2020-04-21</td>\n",
       "      <td>NaN</td>\n",
       "      <td>NaN</td>\n",
       "      <td>41.0</td>\n",
       "      <td>Afghanistan</td>\n",
       "      <td>112</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>41</th>\n",
       "      <td>NaN</td>\n",
       "      <td>NaN</td>\n",
       "      <td>Afghanistan</td>\n",
       "      <td>33.0</td>\n",
       "      <td>65.0</td>\n",
       "      <td>2020-04-22</td>\n",
       "      <td>NaN</td>\n",
       "      <td>NaN</td>\n",
       "      <td>42.0</td>\n",
       "      <td>Afghanistan</td>\n",
       "      <td>113</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>42</th>\n",
       "      <td>NaN</td>\n",
       "      <td>NaN</td>\n",
       "      <td>Afghanistan</td>\n",
       "      <td>33.0</td>\n",
       "      <td>65.0</td>\n",
       "      <td>2020-04-23</td>\n",
       "      <td>NaN</td>\n",
       "      <td>NaN</td>\n",
       "      <td>43.0</td>\n",
       "      <td>Afghanistan</td>\n",
       "      <td>114</td>\n",
       "    </tr>\n",
       "  </tbody>\n",
       "</table>\n",
       "<p>106 rows × 11 columns</p>\n",
       "</div>"
      ],
      "text/plain": [
       "     Id Province/State Country/Region   Lat  Long       Date  ConfirmedCases  \\\n",
       "0   1.0            NaN    Afghanistan  33.0  65.0 2020-01-22             0.0   \n",
       "1   2.0            NaN    Afghanistan  33.0  65.0 2020-01-23             0.0   \n",
       "2   3.0            NaN    Afghanistan  33.0  65.0 2020-01-24             0.0   \n",
       "3   4.0            NaN    Afghanistan  33.0  65.0 2020-01-25             0.0   \n",
       "4   5.0            NaN    Afghanistan  33.0  65.0 2020-01-26             0.0   \n",
       "..  ...            ...            ...   ...   ...        ...             ...   \n",
       "38  NaN            NaN    Afghanistan  33.0  65.0 2020-04-19             NaN   \n",
       "39  NaN            NaN    Afghanistan  33.0  65.0 2020-04-20             NaN   \n",
       "40  NaN            NaN    Afghanistan  33.0  65.0 2020-04-21             NaN   \n",
       "41  NaN            NaN    Afghanistan  33.0  65.0 2020-04-22             NaN   \n",
       "42  NaN            NaN    Afghanistan  33.0  65.0 2020-04-23             NaN   \n",
       "\n",
       "    Fatalities  ForecastId     place_id  day  \n",
       "0          0.0         NaN  Afghanistan   22  \n",
       "1          0.0         NaN  Afghanistan   23  \n",
       "2          0.0         NaN  Afghanistan   24  \n",
       "3          0.0         NaN  Afghanistan   25  \n",
       "4          0.0         NaN  Afghanistan   26  \n",
       "..         ...         ...          ...  ...  \n",
       "38         NaN        39.0  Afghanistan  110  \n",
       "39         NaN        40.0  Afghanistan  111  \n",
       "40         NaN        41.0  Afghanistan  112  \n",
       "41         NaN        42.0  Afghanistan  113  \n",
       "42         NaN        43.0  Afghanistan  114  \n",
       "\n",
       "[106 rows x 11 columns]"
      ]
     },
     "execution_count": 44,
     "metadata": {},
     "output_type": "execute_result"
    }
   ],
   "source": [
    "df_traintest[df_traintest[\"place_id\"]==\"Afghanistan\"]  ######################各地区一直到4.23的数据"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 22,
   "metadata": {},
   "outputs": [],
   "source": [
    "##################可以计算每天的死亡确诊人数了"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 45,
   "metadata": {},
   "outputs": [],
   "source": [
    "import copy  #######新的模块,deepcopy是完全独立的复制\n",
    "places=df_traintest[\"place_id\"].unique()########对每一个地区进行新生追踪"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 46,
   "metadata": {},
   "outputs": [
    {
     "name": "stderr",
     "output_type": "stream",
     "text": [
      "F:\\Anaconda\\lib\\site-packages\\ipykernel_launcher.py:7: SettingWithCopyWarning: \n",
      "A value is trying to be set on a copy of a slice from a DataFrame\n",
      "\n",
      "See the caveats in the documentation: https://pandas.pydata.org/pandas-docs/stable/user_guide/indexing.html#returning-a-view-versus-a-copy\n",
      "  import sys\n",
      "F:\\Anaconda\\lib\\site-packages\\ipykernel_launcher.py:10: SettingWithCopyWarning: \n",
      "A value is trying to be set on a copy of a slice from a DataFrame\n",
      "\n",
      "See the caveats in the documentation: https://pandas.pydata.org/pandas-docs/stable/user_guide/indexing.html#returning-a-view-versus-a-copy\n",
      "  # Remove the CWD from sys.path while we load stuff.\n"
     ]
    }
   ],
   "source": [
    "df_traintest2=copy.deepcopy(df_traintest)\n",
    "df_traintest2[\"cases/day\"]=0\n",
    "df_traintest2[\"fatal/day\"]=0\n",
    "for place in places:\n",
    "    tmp=df_traintest2[\"ConfirmedCases\"][df_traintest2[\"place_id\"]==place].values\n",
    "    tmp[1:]=tmp[1:]-tmp[:-1]   #####################每天的新增确诊数目是隔日之差\n",
    "    df_traintest2[\"cases/day\"][df_traintest2[\"place_id\"]==place]=tmp\n",
    "    tmp=df_traintest2[\"Fatalities\"][df_traintest2[\"place_id\"]==place].values\n",
    "    tmp[1:]=tmp[1:]-tmp[:-1]\n",
    "    df_traintest2[\"fatal/day\"][df_traintest2[\"place_id\"]==place]=tmp"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 47,
   "metadata": {},
   "outputs": [
    {
     "data": {
      "text/html": [
       "<div>\n",
       "<style scoped>\n",
       "    .dataframe tbody tr th:only-of-type {\n",
       "        vertical-align: middle;\n",
       "    }\n",
       "\n",
       "    .dataframe tbody tr th {\n",
       "        vertical-align: top;\n",
       "    }\n",
       "\n",
       "    .dataframe thead th {\n",
       "        text-align: right;\n",
       "    }\n",
       "</style>\n",
       "<table border=\"1\" class=\"dataframe\">\n",
       "  <thead>\n",
       "    <tr style=\"text-align: right;\">\n",
       "      <th></th>\n",
       "      <th>Id</th>\n",
       "      <th>Province/State</th>\n",
       "      <th>Country/Region</th>\n",
       "      <th>Lat</th>\n",
       "      <th>Long</th>\n",
       "      <th>Date</th>\n",
       "      <th>ConfirmedCases</th>\n",
       "      <th>Fatalities</th>\n",
       "      <th>ForecastId</th>\n",
       "      <th>place_id</th>\n",
       "      <th>day</th>\n",
       "      <th>cases/day</th>\n",
       "      <th>fatal/day</th>\n",
       "    </tr>\n",
       "  </thead>\n",
       "  <tbody>\n",
       "    <tr>\n",
       "      <th>3780</th>\n",
       "      <td>5581.0</td>\n",
       "      <td>Hubei</td>\n",
       "      <td>China</td>\n",
       "      <td>30.9756</td>\n",
       "      <td>112.2707</td>\n",
       "      <td>2020-01-22</td>\n",
       "      <td>444.0</td>\n",
       "      <td>17.0</td>\n",
       "      <td>NaN</td>\n",
       "      <td>China/Hubei</td>\n",
       "      <td>22</td>\n",
       "      <td>444</td>\n",
       "      <td>17</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>3781</th>\n",
       "      <td>5582.0</td>\n",
       "      <td>Hubei</td>\n",
       "      <td>China</td>\n",
       "      <td>30.9756</td>\n",
       "      <td>112.2707</td>\n",
       "      <td>2020-01-23</td>\n",
       "      <td>444.0</td>\n",
       "      <td>17.0</td>\n",
       "      <td>NaN</td>\n",
       "      <td>China/Hubei</td>\n",
       "      <td>23</td>\n",
       "      <td>0</td>\n",
       "      <td>0</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>3782</th>\n",
       "      <td>5583.0</td>\n",
       "      <td>Hubei</td>\n",
       "      <td>China</td>\n",
       "      <td>30.9756</td>\n",
       "      <td>112.2707</td>\n",
       "      <td>2020-01-24</td>\n",
       "      <td>549.0</td>\n",
       "      <td>24.0</td>\n",
       "      <td>NaN</td>\n",
       "      <td>China/Hubei</td>\n",
       "      <td>24</td>\n",
       "      <td>105</td>\n",
       "      <td>7</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>3783</th>\n",
       "      <td>5584.0</td>\n",
       "      <td>Hubei</td>\n",
       "      <td>China</td>\n",
       "      <td>30.9756</td>\n",
       "      <td>112.2707</td>\n",
       "      <td>2020-01-25</td>\n",
       "      <td>761.0</td>\n",
       "      <td>40.0</td>\n",
       "      <td>NaN</td>\n",
       "      <td>China/Hubei</td>\n",
       "      <td>25</td>\n",
       "      <td>212</td>\n",
       "      <td>16</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>3784</th>\n",
       "      <td>5585.0</td>\n",
       "      <td>Hubei</td>\n",
       "      <td>China</td>\n",
       "      <td>30.9756</td>\n",
       "      <td>112.2707</td>\n",
       "      <td>2020-01-26</td>\n",
       "      <td>1058.0</td>\n",
       "      <td>52.0</td>\n",
       "      <td>NaN</td>\n",
       "      <td>China/Hubei</td>\n",
       "      <td>26</td>\n",
       "      <td>297</td>\n",
       "      <td>12</td>\n",
       "    </tr>\n",
       "  </tbody>\n",
       "</table>\n",
       "</div>"
      ],
      "text/plain": [
       "          Id Province/State Country/Region      Lat      Long       Date  \\\n",
       "3780  5581.0          Hubei          China  30.9756  112.2707 2020-01-22   \n",
       "3781  5582.0          Hubei          China  30.9756  112.2707 2020-01-23   \n",
       "3782  5583.0          Hubei          China  30.9756  112.2707 2020-01-24   \n",
       "3783  5584.0          Hubei          China  30.9756  112.2707 2020-01-25   \n",
       "3784  5585.0          Hubei          China  30.9756  112.2707 2020-01-26   \n",
       "\n",
       "      ConfirmedCases  Fatalities  ForecastId     place_id  day  cases/day  \\\n",
       "3780           444.0        17.0         NaN  China/Hubei   22        444   \n",
       "3781           444.0        17.0         NaN  China/Hubei   23          0   \n",
       "3782           549.0        24.0         NaN  China/Hubei   24        105   \n",
       "3783           761.0        40.0         NaN  China/Hubei   25        212   \n",
       "3784          1058.0        52.0         NaN  China/Hubei   26        297   \n",
       "\n",
       "      fatal/day  \n",
       "3780         17  \n",
       "3781          0  \n",
       "3782          7  \n",
       "3783         16  \n",
       "3784         12  "
      ]
     },
     "execution_count": 47,
     "metadata": {},
     "output_type": "execute_result"
    }
   ],
   "source": [
    "df_traintest2[df_traintest2[\"place_id\"]==\"China/Hubei\"].head()   ##########得到了湖北的感染以及致命人数变化"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 31,
   "metadata": {},
   "outputs": [],
   "source": [
    "##########需要搞清楚什么是窗口函数\n",
    "#########这里操作一下rolling函数，滚动求平均值\n",
    "#########回顾一下计量经济学：\n",
    "#########前一段时间的数据蕴含了很多现在一段时间的变量，可以代替这部分变量使用"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 48,
   "metadata": {},
   "outputs": [],
   "source": [
    "def df_aggregation(df,col,mean_range):\n",
    "    df_new=copy.deepcopy(df)  \n",
    "    col_new='{}-({}-{})'.format(col,mean_range[0],mean_range[1])###############\n",
    "    df_new[col_new]=0\n",
    "    tmp=df_new[col].rolling(mean_range[1]-mean_range[0]+1).mean() #################都是每7天滚动求一次均值\n",
    "    df_new[col_new][mean_range[0]:]=tmp[:-(mean_range[0])]    ##################手动延后时间序列\n",
    "    df_new[col_new][pd.isna(df_new[col_new])]=0       \n",
    "    return df_new[[col_new]].reset_index(drop=True)  #####################完全把原来的索引丢弃掉，设立新的数字索引"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 49,
   "metadata": {},
   "outputs": [],
   "source": [
    "def do_aggregations(df):\n",
    "    df=(pd.concat([df,df_aggregation(df,'cases/day',[1,1])],axis=1)).reset_index(drop=True)\n",
    "    df=(pd.concat([df,df_aggregation(df,'cases/day',[1,7])],axis=1)).reset_index(drop=True)\n",
    "    df=(pd.concat([df,df_aggregation(df,'cases/day',[8,14])],axis=1)).reset_index(drop=True)\n",
    "    df=(pd.concat([df,df_aggregation(df,'cases/day',[15,21])],axis=1)).reset_index(drop=True)\n",
    "    df=(pd.concat([df,df_aggregation(df,'fatal/day',[1,1])],axis=1)).reset_index(drop=True)\n",
    "    df=(pd.concat([df,df_aggregation(df,'fatal/day',[1,7])],axis=1)).reset_index(drop=True)\n",
    "    df=(pd.concat([df,df_aggregation(df,'fatal/day',[8,14])],axis=1)).reset_index(drop=True)\n",
    "    df=(pd.concat([df,df_aggregation(df,'fatal/day',[15,21])],axis=1)).reset_index(drop=True)\n",
    "    for threshold in[1,10,100]: ################设立不同的阈值求和\n",
    "        days_under_threshold=(df['ConfirmedCases']<threshold).sum()\n",
    "        tmp=df[\"day\"]-22-days_under_threshold\n",
    "        tmp[tmp<0]=0                            ###########照顾到22号之前已经爆发的地区，比如中国湖北\n",
    "        df[\"days_since_{}cases\".format(threshold)]=tmp\n",
    "    for threshold in [1, 10, 100]:\n",
    "        days_under_threshold = (df['Fatalities']<threshold).sum()\n",
    "        tmp = df['day'].values - 22 - days_under_threshold\n",
    "        tmp[tmp<=0] = 0\n",
    "        df['days_since_{}fatal'.format(threshold)] = tmp\n",
    "    if df['place_id'][0]=='China/Hubei':             #################湖北爆发时间比其他地区早，需要特别调整\n",
    "        df['days_since_1cases'] += 35 # 2019/12/8\n",
    "        df['days_since_10cases'] += 35-13 # 2019/12/8-2020/1/2 assume 2019/12/8+13\n",
    "        df['days_since_100cases'] += 4 # 2020/1/18\n",
    "        df['days_since_1fatal'] += 13 # 2020/1/9\n",
    "    return df"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 34,
   "metadata": {},
   "outputs": [],
   "source": [
    "##################分不同地区进行汇总处理"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 50,
   "metadata": {},
   "outputs": [
    {
     "name": "stderr",
     "output_type": "stream",
     "text": [
      "F:\\Anaconda\\lib\\site-packages\\ipykernel_launcher.py:6: SettingWithCopyWarning: \n",
      "A value is trying to be set on a copy of a slice from a DataFrame\n",
      "\n",
      "See the caveats in the documentation: https://pandas.pydata.org/pandas-docs/stable/user_guide/indexing.html#returning-a-view-versus-a-copy\n",
      "  \n",
      "F:\\Anaconda\\lib\\site-packages\\ipykernel_launcher.py:7: SettingWithCopyWarning: \n",
      "A value is trying to be set on a copy of a slice from a DataFrame\n",
      "\n",
      "See the caveats in the documentation: https://pandas.pydata.org/pandas-docs/stable/user_guide/indexing.html#returning-a-view-versus-a-copy\n",
      "  import sys\n"
     ]
    },
    {
     "data": {
      "text/html": [
       "<div>\n",
       "<style scoped>\n",
       "    .dataframe tbody tr th:only-of-type {\n",
       "        vertical-align: middle;\n",
       "    }\n",
       "\n",
       "    .dataframe tbody tr th {\n",
       "        vertical-align: top;\n",
       "    }\n",
       "\n",
       "    .dataframe thead th {\n",
       "        text-align: right;\n",
       "    }\n",
       "</style>\n",
       "<table border=\"1\" class=\"dataframe\">\n",
       "  <thead>\n",
       "    <tr style=\"text-align: right;\">\n",
       "      <th></th>\n",
       "      <th>Id</th>\n",
       "      <th>Province/State</th>\n",
       "      <th>Country/Region</th>\n",
       "      <th>Lat</th>\n",
       "      <th>Long</th>\n",
       "      <th>Date</th>\n",
       "      <th>ConfirmedCases</th>\n",
       "      <th>Fatalities</th>\n",
       "      <th>ForecastId</th>\n",
       "      <th>place_id</th>\n",
       "      <th>day</th>\n",
       "      <th>cases/day</th>\n",
       "      <th>fatal/day</th>\n",
       "      <th>cases/day-(1-1)</th>\n",
       "      <th>cases/day-(1-7)</th>\n",
       "      <th>cases/day-(8-14)</th>\n",
       "      <th>cases/day-(15-21)</th>\n",
       "      <th>fatal/day-(1-1)</th>\n",
       "      <th>fatal/day-(1-7)</th>\n",
       "      <th>fatal/day-(8-14)</th>\n",
       "      <th>fatal/day-(15-21)</th>\n",
       "      <th>days_since_1cases</th>\n",
       "      <th>days_since_10cases</th>\n",
       "      <th>days_since_100cases</th>\n",
       "      <th>days_since_1fatal</th>\n",
       "      <th>days_since_10fatal</th>\n",
       "      <th>days_since_100fatal</th>\n",
       "    </tr>\n",
       "  </thead>\n",
       "  <tbody>\n",
       "    <tr>\n",
       "      <th>6360</th>\n",
       "      <td>5581.0</td>\n",
       "      <td>Hubei</td>\n",
       "      <td>China</td>\n",
       "      <td>30.9756</td>\n",
       "      <td>112.2707</td>\n",
       "      <td>2020-01-22</td>\n",
       "      <td>444.0</td>\n",
       "      <td>17.0</td>\n",
       "      <td>NaN</td>\n",
       "      <td>China/Hubei</td>\n",
       "      <td>22</td>\n",
       "      <td>444</td>\n",
       "      <td>17</td>\n",
       "      <td>0.0</td>\n",
       "      <td>0.0</td>\n",
       "      <td>0.0</td>\n",
       "      <td>0.0</td>\n",
       "      <td>0.0</td>\n",
       "      <td>0.0</td>\n",
       "      <td>0.0</td>\n",
       "      <td>0.0</td>\n",
       "      <td>35</td>\n",
       "      <td>22</td>\n",
       "      <td>4</td>\n",
       "      <td>13</td>\n",
       "      <td>0</td>\n",
       "      <td>0</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>6361</th>\n",
       "      <td>5582.0</td>\n",
       "      <td>Hubei</td>\n",
       "      <td>China</td>\n",
       "      <td>30.9756</td>\n",
       "      <td>112.2707</td>\n",
       "      <td>2020-01-23</td>\n",
       "      <td>444.0</td>\n",
       "      <td>17.0</td>\n",
       "      <td>NaN</td>\n",
       "      <td>China/Hubei</td>\n",
       "      <td>23</td>\n",
       "      <td>0</td>\n",
       "      <td>0</td>\n",
       "      <td>444.0</td>\n",
       "      <td>0.0</td>\n",
       "      <td>0.0</td>\n",
       "      <td>0.0</td>\n",
       "      <td>17.0</td>\n",
       "      <td>0.0</td>\n",
       "      <td>0.0</td>\n",
       "      <td>0.0</td>\n",
       "      <td>36</td>\n",
       "      <td>23</td>\n",
       "      <td>5</td>\n",
       "      <td>14</td>\n",
       "      <td>1</td>\n",
       "      <td>0</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>6362</th>\n",
       "      <td>5583.0</td>\n",
       "      <td>Hubei</td>\n",
       "      <td>China</td>\n",
       "      <td>30.9756</td>\n",
       "      <td>112.2707</td>\n",
       "      <td>2020-01-24</td>\n",
       "      <td>549.0</td>\n",
       "      <td>24.0</td>\n",
       "      <td>NaN</td>\n",
       "      <td>China/Hubei</td>\n",
       "      <td>24</td>\n",
       "      <td>105</td>\n",
       "      <td>7</td>\n",
       "      <td>0.0</td>\n",
       "      <td>0.0</td>\n",
       "      <td>0.0</td>\n",
       "      <td>0.0</td>\n",
       "      <td>0.0</td>\n",
       "      <td>0.0</td>\n",
       "      <td>0.0</td>\n",
       "      <td>0.0</td>\n",
       "      <td>37</td>\n",
       "      <td>24</td>\n",
       "      <td>6</td>\n",
       "      <td>15</td>\n",
       "      <td>2</td>\n",
       "      <td>0</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>6363</th>\n",
       "      <td>5584.0</td>\n",
       "      <td>Hubei</td>\n",
       "      <td>China</td>\n",
       "      <td>30.9756</td>\n",
       "      <td>112.2707</td>\n",
       "      <td>2020-01-25</td>\n",
       "      <td>761.0</td>\n",
       "      <td>40.0</td>\n",
       "      <td>NaN</td>\n",
       "      <td>China/Hubei</td>\n",
       "      <td>25</td>\n",
       "      <td>212</td>\n",
       "      <td>16</td>\n",
       "      <td>105.0</td>\n",
       "      <td>0.0</td>\n",
       "      <td>0.0</td>\n",
       "      <td>0.0</td>\n",
       "      <td>7.0</td>\n",
       "      <td>0.0</td>\n",
       "      <td>0.0</td>\n",
       "      <td>0.0</td>\n",
       "      <td>38</td>\n",
       "      <td>25</td>\n",
       "      <td>7</td>\n",
       "      <td>16</td>\n",
       "      <td>3</td>\n",
       "      <td>0</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>6364</th>\n",
       "      <td>5585.0</td>\n",
       "      <td>Hubei</td>\n",
       "      <td>China</td>\n",
       "      <td>30.9756</td>\n",
       "      <td>112.2707</td>\n",
       "      <td>2020-01-26</td>\n",
       "      <td>1058.0</td>\n",
       "      <td>52.0</td>\n",
       "      <td>NaN</td>\n",
       "      <td>China/Hubei</td>\n",
       "      <td>26</td>\n",
       "      <td>297</td>\n",
       "      <td>12</td>\n",
       "      <td>212.0</td>\n",
       "      <td>0.0</td>\n",
       "      <td>0.0</td>\n",
       "      <td>0.0</td>\n",
       "      <td>16.0</td>\n",
       "      <td>0.0</td>\n",
       "      <td>0.0</td>\n",
       "      <td>0.0</td>\n",
       "      <td>39</td>\n",
       "      <td>26</td>\n",
       "      <td>8</td>\n",
       "      <td>17</td>\n",
       "      <td>4</td>\n",
       "      <td>0</td>\n",
       "    </tr>\n",
       "  </tbody>\n",
       "</table>\n",
       "</div>"
      ],
      "text/plain": [
       "          Id Province/State Country/Region      Lat      Long       Date  \\\n",
       "6360  5581.0          Hubei          China  30.9756  112.2707 2020-01-22   \n",
       "6361  5582.0          Hubei          China  30.9756  112.2707 2020-01-23   \n",
       "6362  5583.0          Hubei          China  30.9756  112.2707 2020-01-24   \n",
       "6363  5584.0          Hubei          China  30.9756  112.2707 2020-01-25   \n",
       "6364  5585.0          Hubei          China  30.9756  112.2707 2020-01-26   \n",
       "\n",
       "      ConfirmedCases  Fatalities  ForecastId     place_id  day  cases/day  \\\n",
       "6360           444.0        17.0         NaN  China/Hubei   22        444   \n",
       "6361           444.0        17.0         NaN  China/Hubei   23          0   \n",
       "6362           549.0        24.0         NaN  China/Hubei   24        105   \n",
       "6363           761.0        40.0         NaN  China/Hubei   25        212   \n",
       "6364          1058.0        52.0         NaN  China/Hubei   26        297   \n",
       "\n",
       "      fatal/day  cases/day-(1-1)  cases/day-(1-7)  cases/day-(8-14)  \\\n",
       "6360         17              0.0              0.0               0.0   \n",
       "6361          0            444.0              0.0               0.0   \n",
       "6362          7              0.0              0.0               0.0   \n",
       "6363         16            105.0              0.0               0.0   \n",
       "6364         12            212.0              0.0               0.0   \n",
       "\n",
       "      cases/day-(15-21)  fatal/day-(1-1)  fatal/day-(1-7)  fatal/day-(8-14)  \\\n",
       "6360                0.0              0.0              0.0               0.0   \n",
       "6361                0.0             17.0              0.0               0.0   \n",
       "6362                0.0              0.0              0.0               0.0   \n",
       "6363                0.0              7.0              0.0               0.0   \n",
       "6364                0.0             16.0              0.0               0.0   \n",
       "\n",
       "      fatal/day-(15-21)  days_since_1cases  days_since_10cases  \\\n",
       "6360                0.0                 35                  22   \n",
       "6361                0.0                 36                  23   \n",
       "6362                0.0                 37                  24   \n",
       "6363                0.0                 38                  25   \n",
       "6364                0.0                 39                  26   \n",
       "\n",
       "      days_since_100cases  days_since_1fatal  days_since_10fatal  \\\n",
       "6360                    4                 13                   0   \n",
       "6361                    5                 14                   1   \n",
       "6362                    6                 15                   2   \n",
       "6363                    7                 16                   3   \n",
       "6364                    8                 17                   4   \n",
       "\n",
       "      days_since_100fatal  \n",
       "6360                    0  \n",
       "6361                    0  \n",
       "6362                    0  \n",
       "6363                    0  \n",
       "6364                    0  "
      ]
     },
     "execution_count": 50,
     "metadata": {},
     "output_type": "execute_result"
    }
   ],
   "source": [
    "df_traintest3=[]\n",
    "for place in places:\n",
    "    df_tmp=df_traintest2[df_traintest2[\"place_id\"]==place].reset_index(drop=True)\n",
    "    df_tmp=do_aggregations(df_tmp)\n",
    "    df_traintest3.append(df_tmp)\n",
    "df_traintest3=pd.concat(df_traintest3).reset_index(drop=True)\n",
    "df_traintest3[df_traintest3[\"place_id\"]==\"China/Hubei\"].head()"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 36,
   "metadata": {},
   "outputs": [],
   "source": [
    "##################开始引入新的数据,这是数据分析一个亮点，引入了不同国家吸烟率，吸烟肺功能下降，可能影响肺炎传播\n",
    "##################艾滋病率,政府年卫生投入资金都是有关可以考虑的数据\n",
    "#################肥胖率我也想引入,胖子不愿意出门活动，可能会减缓传染？\n",
    "##################吸烟数据:https://ourworldindata.org/smoking\n",
    "##################从世界禁烟组织得到了这张表"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 51,
   "metadata": {},
   "outputs": [],
   "source": [
    "smoke_path=r\"F:\\kaggle\\covid-first\\share-of-adults-who-smoke.csv\""
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 52,
   "metadata": {},
   "outputs": [],
   "source": [
    "df_smoking=pd.read_csv(smoke_path)"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 53,
   "metadata": {},
   "outputs": [
    {
     "data": {
      "text/html": [
       "<div>\n",
       "<style scoped>\n",
       "    .dataframe tbody tr th:only-of-type {\n",
       "        vertical-align: middle;\n",
       "    }\n",
       "\n",
       "    .dataframe tbody tr th {\n",
       "        vertical-align: top;\n",
       "    }\n",
       "\n",
       "    .dataframe thead th {\n",
       "        text-align: right;\n",
       "    }\n",
       "</style>\n",
       "<table border=\"1\" class=\"dataframe\">\n",
       "  <thead>\n",
       "    <tr style=\"text-align: right;\">\n",
       "      <th></th>\n",
       "      <th>Entity</th>\n",
       "      <th>Code</th>\n",
       "      <th>Year</th>\n",
       "      <th>Smoking prevalence, total (ages 15+) (% of adults)</th>\n",
       "    </tr>\n",
       "  </thead>\n",
       "  <tbody>\n",
       "    <tr>\n",
       "      <th>0</th>\n",
       "      <td>Albania</td>\n",
       "      <td>ALB</td>\n",
       "      <td>2000</td>\n",
       "      <td>34.8</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>1</th>\n",
       "      <td>Albania</td>\n",
       "      <td>ALB</td>\n",
       "      <td>2005</td>\n",
       "      <td>32.7</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>2</th>\n",
       "      <td>Albania</td>\n",
       "      <td>ALB</td>\n",
       "      <td>2010</td>\n",
       "      <td>31.2</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>3</th>\n",
       "      <td>Albania</td>\n",
       "      <td>ALB</td>\n",
       "      <td>2011</td>\n",
       "      <td>30.7</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>4</th>\n",
       "      <td>Albania</td>\n",
       "      <td>ALB</td>\n",
       "      <td>2012</td>\n",
       "      <td>30.2</td>\n",
       "    </tr>\n",
       "  </tbody>\n",
       "</table>\n",
       "</div>"
      ],
      "text/plain": [
       "    Entity Code  Year  Smoking prevalence, total (ages 15+) (% of adults)\n",
       "0  Albania  ALB  2000                                               34.8 \n",
       "1  Albania  ALB  2005                                               32.7 \n",
       "2  Albania  ALB  2010                                               31.2 \n",
       "3  Albania  ALB  2011                                               30.7 \n",
       "4  Albania  ALB  2012                                               30.2 "
      ]
     },
     "execution_count": 53,
     "metadata": {},
     "output_type": "execute_result"
    }
   ],
   "source": [
    "df_smoking.head()"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 40,
   "metadata": {},
   "outputs": [],
   "source": [
    "##########抽取新的数据，只要最新的"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 41,
   "metadata": {},
   "outputs": [],
   "source": [
    "##########倒序排列"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 54,
   "metadata": {},
   "outputs": [
    {
     "data": {
      "text/html": [
       "<div>\n",
       "<style scoped>\n",
       "    .dataframe tbody tr th:only-of-type {\n",
       "        vertical-align: middle;\n",
       "    }\n",
       "\n",
       "    .dataframe tbody tr th {\n",
       "        vertical-align: top;\n",
       "    }\n",
       "\n",
       "    .dataframe thead th {\n",
       "        text-align: right;\n",
       "    }\n",
       "</style>\n",
       "<table border=\"1\" class=\"dataframe\">\n",
       "  <thead>\n",
       "    <tr style=\"text-align: right;\">\n",
       "      <th></th>\n",
       "      <th>Entity</th>\n",
       "      <th>Code</th>\n",
       "      <th>Year</th>\n",
       "      <th>Smoking prevalence, total (ages 15+) (% of adults)</th>\n",
       "      <th>Country/Region</th>\n",
       "      <th>SmokingRate</th>\n",
       "    </tr>\n",
       "  </thead>\n",
       "  <tbody>\n",
       "    <tr>\n",
       "      <th>0</th>\n",
       "      <td>Zimbabwe</td>\n",
       "      <td>ZWE</td>\n",
       "      <td>2016</td>\n",
       "      <td>15.8</td>\n",
       "      <td>Zimbabwe</td>\n",
       "      <td>15.8</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>1</th>\n",
       "      <td>Namibia</td>\n",
       "      <td>NAM</td>\n",
       "      <td>2016</td>\n",
       "      <td>21.4</td>\n",
       "      <td>Namibia</td>\n",
       "      <td>21.4</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>2</th>\n",
       "      <td>Suriname</td>\n",
       "      <td>SUR</td>\n",
       "      <td>2016</td>\n",
       "      <td>25.0</td>\n",
       "      <td>Suriname</td>\n",
       "      <td>25.0</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>3</th>\n",
       "      <td>Morocco</td>\n",
       "      <td>MAR</td>\n",
       "      <td>2016</td>\n",
       "      <td>23.4</td>\n",
       "      <td>Morocco</td>\n",
       "      <td>23.4</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>4</th>\n",
       "      <td>India</td>\n",
       "      <td>IND</td>\n",
       "      <td>2016</td>\n",
       "      <td>11.5</td>\n",
       "      <td>India</td>\n",
       "      <td>11.5</td>\n",
       "    </tr>\n",
       "  </tbody>\n",
       "</table>\n",
       "</div>"
      ],
      "text/plain": [
       "     Entity Code  Year  Smoking prevalence, total (ages 15+) (% of adults)  \\\n",
       "0  Zimbabwe  ZWE  2016                                               15.8    \n",
       "1   Namibia  NAM  2016                                               21.4    \n",
       "2  Suriname  SUR  2016                                               25.0    \n",
       "3   Morocco  MAR  2016                                               23.4    \n",
       "4     India  IND  2016                                               11.5    \n",
       "\n",
       "  Country/Region  SmokingRate  \n",
       "0       Zimbabwe         15.8  \n",
       "1        Namibia         21.4  \n",
       "2       Suriname         25.0  \n",
       "3        Morocco         23.4  \n",
       "4          India         11.5  "
      ]
     },
     "execution_count": 54,
     "metadata": {},
     "output_type": "execute_result"
    }
   ],
   "source": [
    "df_smoking_recent=df_smoking.sort_values(\"Year\",ascending=False).reset_index(drop=True) \n",
    "####################同个地区多个年份的数据重复\n",
    "df_smoking_recent=df_smoking_recent[df_smoking_recent[\"Entity\"].duplicated()==False]\n",
    "###########################改了两列的名字,没什么大变动,方便之后的连接\n",
    "df_smoking_recent['Country/Region'] = df_smoking_recent['Entity']\n",
    "df_smoking_recent['SmokingRate'] = df_smoking_recent['Smoking prevalence, total (ages 15+) (% of adults)']\n",
    "df_smoking_recent.head()"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 43,
   "metadata": {},
   "outputs": [],
   "source": [
    "##############合并吸烟数据以及死亡确诊数据"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 55,
   "metadata": {},
   "outputs": [
    {
     "name": "stdout",
     "output_type": "stream",
     "text": [
      "(30104, 28)\n"
     ]
    }
   ],
   "source": [
    "df_traintest4 = pd.merge(df_traintest3,df_smoking_recent[[\"Country/Region\",\"SmokingRate\"]],on=\"Country/Region\",how=\"left\")\n",
    "print(df_traintest4.shape)"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 56,
   "metadata": {},
   "outputs": [
    {
     "data": {
      "text/html": [
       "<div>\n",
       "<style scoped>\n",
       "    .dataframe tbody tr th:only-of-type {\n",
       "        vertical-align: middle;\n",
       "    }\n",
       "\n",
       "    .dataframe tbody tr th {\n",
       "        vertical-align: top;\n",
       "    }\n",
       "\n",
       "    .dataframe thead th {\n",
       "        text-align: right;\n",
       "    }\n",
       "</style>\n",
       "<table border=\"1\" class=\"dataframe\">\n",
       "  <thead>\n",
       "    <tr style=\"text-align: right;\">\n",
       "      <th></th>\n",
       "      <th>Id</th>\n",
       "      <th>Province/State</th>\n",
       "      <th>Country/Region</th>\n",
       "      <th>Lat</th>\n",
       "      <th>Long</th>\n",
       "      <th>Date</th>\n",
       "      <th>ConfirmedCases</th>\n",
       "      <th>Fatalities</th>\n",
       "      <th>ForecastId</th>\n",
       "      <th>place_id</th>\n",
       "      <th>day</th>\n",
       "      <th>cases/day</th>\n",
       "      <th>fatal/day</th>\n",
       "      <th>cases/day-(1-1)</th>\n",
       "      <th>cases/day-(1-7)</th>\n",
       "      <th>cases/day-(8-14)</th>\n",
       "      <th>cases/day-(15-21)</th>\n",
       "      <th>fatal/day-(1-1)</th>\n",
       "      <th>fatal/day-(1-7)</th>\n",
       "      <th>fatal/day-(8-14)</th>\n",
       "      <th>fatal/day-(15-21)</th>\n",
       "      <th>days_since_1cases</th>\n",
       "      <th>days_since_10cases</th>\n",
       "      <th>days_since_100cases</th>\n",
       "      <th>days_since_1fatal</th>\n",
       "      <th>days_since_10fatal</th>\n",
       "      <th>days_since_100fatal</th>\n",
       "      <th>SmokingRate</th>\n",
       "    </tr>\n",
       "  </thead>\n",
       "  <tbody>\n",
       "    <tr>\n",
       "      <th>0</th>\n",
       "      <td>1.0</td>\n",
       "      <td>NaN</td>\n",
       "      <td>Afghanistan</td>\n",
       "      <td>33.0</td>\n",
       "      <td>65.0</td>\n",
       "      <td>2020-01-22</td>\n",
       "      <td>0.0</td>\n",
       "      <td>0.0</td>\n",
       "      <td>NaN</td>\n",
       "      <td>Afghanistan</td>\n",
       "      <td>22</td>\n",
       "      <td>0</td>\n",
       "      <td>0</td>\n",
       "      <td>0.0</td>\n",
       "      <td>0.0</td>\n",
       "      <td>0.0</td>\n",
       "      <td>0.0</td>\n",
       "      <td>0.0</td>\n",
       "      <td>0.0</td>\n",
       "      <td>0.0</td>\n",
       "      <td>0.0</td>\n",
       "      <td>0</td>\n",
       "      <td>0</td>\n",
       "      <td>0</td>\n",
       "      <td>0</td>\n",
       "      <td>0</td>\n",
       "      <td>0</td>\n",
       "      <td>NaN</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>1</th>\n",
       "      <td>2.0</td>\n",
       "      <td>NaN</td>\n",
       "      <td>Afghanistan</td>\n",
       "      <td>33.0</td>\n",
       "      <td>65.0</td>\n",
       "      <td>2020-01-23</td>\n",
       "      <td>0.0</td>\n",
       "      <td>0.0</td>\n",
       "      <td>NaN</td>\n",
       "      <td>Afghanistan</td>\n",
       "      <td>23</td>\n",
       "      <td>0</td>\n",
       "      <td>0</td>\n",
       "      <td>0.0</td>\n",
       "      <td>0.0</td>\n",
       "      <td>0.0</td>\n",
       "      <td>0.0</td>\n",
       "      <td>0.0</td>\n",
       "      <td>0.0</td>\n",
       "      <td>0.0</td>\n",
       "      <td>0.0</td>\n",
       "      <td>0</td>\n",
       "      <td>0</td>\n",
       "      <td>0</td>\n",
       "      <td>0</td>\n",
       "      <td>0</td>\n",
       "      <td>0</td>\n",
       "      <td>NaN</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>2</th>\n",
       "      <td>3.0</td>\n",
       "      <td>NaN</td>\n",
       "      <td>Afghanistan</td>\n",
       "      <td>33.0</td>\n",
       "      <td>65.0</td>\n",
       "      <td>2020-01-24</td>\n",
       "      <td>0.0</td>\n",
       "      <td>0.0</td>\n",
       "      <td>NaN</td>\n",
       "      <td>Afghanistan</td>\n",
       "      <td>24</td>\n",
       "      <td>0</td>\n",
       "      <td>0</td>\n",
       "      <td>0.0</td>\n",
       "      <td>0.0</td>\n",
       "      <td>0.0</td>\n",
       "      <td>0.0</td>\n",
       "      <td>0.0</td>\n",
       "      <td>0.0</td>\n",
       "      <td>0.0</td>\n",
       "      <td>0.0</td>\n",
       "      <td>0</td>\n",
       "      <td>0</td>\n",
       "      <td>0</td>\n",
       "      <td>0</td>\n",
       "      <td>0</td>\n",
       "      <td>0</td>\n",
       "      <td>NaN</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>3</th>\n",
       "      <td>4.0</td>\n",
       "      <td>NaN</td>\n",
       "      <td>Afghanistan</td>\n",
       "      <td>33.0</td>\n",
       "      <td>65.0</td>\n",
       "      <td>2020-01-25</td>\n",
       "      <td>0.0</td>\n",
       "      <td>0.0</td>\n",
       "      <td>NaN</td>\n",
       "      <td>Afghanistan</td>\n",
       "      <td>25</td>\n",
       "      <td>0</td>\n",
       "      <td>0</td>\n",
       "      <td>0.0</td>\n",
       "      <td>0.0</td>\n",
       "      <td>0.0</td>\n",
       "      <td>0.0</td>\n",
       "      <td>0.0</td>\n",
       "      <td>0.0</td>\n",
       "      <td>0.0</td>\n",
       "      <td>0.0</td>\n",
       "      <td>0</td>\n",
       "      <td>0</td>\n",
       "      <td>0</td>\n",
       "      <td>0</td>\n",
       "      <td>0</td>\n",
       "      <td>0</td>\n",
       "      <td>NaN</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>4</th>\n",
       "      <td>5.0</td>\n",
       "      <td>NaN</td>\n",
       "      <td>Afghanistan</td>\n",
       "      <td>33.0</td>\n",
       "      <td>65.0</td>\n",
       "      <td>2020-01-26</td>\n",
       "      <td>0.0</td>\n",
       "      <td>0.0</td>\n",
       "      <td>NaN</td>\n",
       "      <td>Afghanistan</td>\n",
       "      <td>26</td>\n",
       "      <td>0</td>\n",
       "      <td>0</td>\n",
       "      <td>0.0</td>\n",
       "      <td>0.0</td>\n",
       "      <td>0.0</td>\n",
       "      <td>0.0</td>\n",
       "      <td>0.0</td>\n",
       "      <td>0.0</td>\n",
       "      <td>0.0</td>\n",
       "      <td>0.0</td>\n",
       "      <td>0</td>\n",
       "      <td>0</td>\n",
       "      <td>0</td>\n",
       "      <td>0</td>\n",
       "      <td>0</td>\n",
       "      <td>0</td>\n",
       "      <td>NaN</td>\n",
       "    </tr>\n",
       "  </tbody>\n",
       "</table>\n",
       "</div>"
      ],
      "text/plain": [
       "    Id Province/State Country/Region   Lat  Long       Date  ConfirmedCases  \\\n",
       "0  1.0            NaN    Afghanistan  33.0  65.0 2020-01-22             0.0   \n",
       "1  2.0            NaN    Afghanistan  33.0  65.0 2020-01-23             0.0   \n",
       "2  3.0            NaN    Afghanistan  33.0  65.0 2020-01-24             0.0   \n",
       "3  4.0            NaN    Afghanistan  33.0  65.0 2020-01-25             0.0   \n",
       "4  5.0            NaN    Afghanistan  33.0  65.0 2020-01-26             0.0   \n",
       "\n",
       "   Fatalities  ForecastId     place_id  day  cases/day  fatal/day  \\\n",
       "0         0.0         NaN  Afghanistan   22          0          0   \n",
       "1         0.0         NaN  Afghanistan   23          0          0   \n",
       "2         0.0         NaN  Afghanistan   24          0          0   \n",
       "3         0.0         NaN  Afghanistan   25          0          0   \n",
       "4         0.0         NaN  Afghanistan   26          0          0   \n",
       "\n",
       "   cases/day-(1-1)  cases/day-(1-7)  cases/day-(8-14)  cases/day-(15-21)  \\\n",
       "0              0.0              0.0               0.0                0.0   \n",
       "1              0.0              0.0               0.0                0.0   \n",
       "2              0.0              0.0               0.0                0.0   \n",
       "3              0.0              0.0               0.0                0.0   \n",
       "4              0.0              0.0               0.0                0.0   \n",
       "\n",
       "   fatal/day-(1-1)  fatal/day-(1-7)  fatal/day-(8-14)  fatal/day-(15-21)  \\\n",
       "0              0.0              0.0               0.0                0.0   \n",
       "1              0.0              0.0               0.0                0.0   \n",
       "2              0.0              0.0               0.0                0.0   \n",
       "3              0.0              0.0               0.0                0.0   \n",
       "4              0.0              0.0               0.0                0.0   \n",
       "\n",
       "   days_since_1cases  days_since_10cases  days_since_100cases  \\\n",
       "0                  0                   0                    0   \n",
       "1                  0                   0                    0   \n",
       "2                  0                   0                    0   \n",
       "3                  0                   0                    0   \n",
       "4                  0                   0                    0   \n",
       "\n",
       "   days_since_1fatal  days_since_10fatal  days_since_100fatal  SmokingRate  \n",
       "0                  0                   0                    0          NaN  \n",
       "1                  0                   0                    0          NaN  \n",
       "2                  0                   0                    0          NaN  \n",
       "3                  0                   0                    0          NaN  \n",
       "4                  0                   0                    0          NaN  "
      ]
     },
     "execution_count": 56,
     "metadata": {},
     "output_type": "execute_result"
    }
   ],
   "source": [
    "df_traintest4.head() ########前面几项都是NaN,代表吸烟率表格中没有数据相匹配"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 46,
   "metadata": {},
   "outputs": [],
   "source": [
    "#################这里存在不匹配的一个问题：以湖北为例子,不可能精细到湖北人民的吸烟率，只能用全国吸烟率去代替"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 57,
   "metadata": {},
   "outputs": [
    {
     "data": {
      "text/html": [
       "<div>\n",
       "<style scoped>\n",
       "    .dataframe tbody tr th:only-of-type {\n",
       "        vertical-align: middle;\n",
       "    }\n",
       "\n",
       "    .dataframe tbody tr th {\n",
       "        vertical-align: top;\n",
       "    }\n",
       "\n",
       "    .dataframe thead th {\n",
       "        text-align: right;\n",
       "    }\n",
       "</style>\n",
       "<table border=\"1\" class=\"dataframe\">\n",
       "  <thead>\n",
       "    <tr style=\"text-align: right;\">\n",
       "      <th></th>\n",
       "      <th>Id</th>\n",
       "      <th>Province/State</th>\n",
       "      <th>Country/Region</th>\n",
       "      <th>Lat</th>\n",
       "      <th>Long</th>\n",
       "      <th>Date</th>\n",
       "      <th>ConfirmedCases</th>\n",
       "      <th>Fatalities</th>\n",
       "      <th>ForecastId</th>\n",
       "      <th>place_id</th>\n",
       "      <th>day</th>\n",
       "      <th>cases/day</th>\n",
       "      <th>fatal/day</th>\n",
       "      <th>cases/day-(1-1)</th>\n",
       "      <th>cases/day-(1-7)</th>\n",
       "      <th>cases/day-(8-14)</th>\n",
       "      <th>cases/day-(15-21)</th>\n",
       "      <th>fatal/day-(1-1)</th>\n",
       "      <th>fatal/day-(1-7)</th>\n",
       "      <th>fatal/day-(8-14)</th>\n",
       "      <th>fatal/day-(15-21)</th>\n",
       "      <th>days_since_1cases</th>\n",
       "      <th>days_since_10cases</th>\n",
       "      <th>days_since_100cases</th>\n",
       "      <th>days_since_1fatal</th>\n",
       "      <th>days_since_10fatal</th>\n",
       "      <th>days_since_100fatal</th>\n",
       "      <th>SmokingRate</th>\n",
       "    </tr>\n",
       "  </thead>\n",
       "  <tbody>\n",
       "    <tr>\n",
       "      <th>6360</th>\n",
       "      <td>5581.0</td>\n",
       "      <td>Hubei</td>\n",
       "      <td>China</td>\n",
       "      <td>30.9756</td>\n",
       "      <td>112.2707</td>\n",
       "      <td>2020-01-22</td>\n",
       "      <td>444.0</td>\n",
       "      <td>17.0</td>\n",
       "      <td>NaN</td>\n",
       "      <td>China/Hubei</td>\n",
       "      <td>22</td>\n",
       "      <td>444</td>\n",
       "      <td>17</td>\n",
       "      <td>0.0</td>\n",
       "      <td>0.0</td>\n",
       "      <td>0.0</td>\n",
       "      <td>0.0</td>\n",
       "      <td>0.0</td>\n",
       "      <td>0.0</td>\n",
       "      <td>0.0</td>\n",
       "      <td>0.0</td>\n",
       "      <td>35</td>\n",
       "      <td>22</td>\n",
       "      <td>4</td>\n",
       "      <td>13</td>\n",
       "      <td>0</td>\n",
       "      <td>0</td>\n",
       "      <td>25.6</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>6361</th>\n",
       "      <td>5582.0</td>\n",
       "      <td>Hubei</td>\n",
       "      <td>China</td>\n",
       "      <td>30.9756</td>\n",
       "      <td>112.2707</td>\n",
       "      <td>2020-01-23</td>\n",
       "      <td>444.0</td>\n",
       "      <td>17.0</td>\n",
       "      <td>NaN</td>\n",
       "      <td>China/Hubei</td>\n",
       "      <td>23</td>\n",
       "      <td>0</td>\n",
       "      <td>0</td>\n",
       "      <td>444.0</td>\n",
       "      <td>0.0</td>\n",
       "      <td>0.0</td>\n",
       "      <td>0.0</td>\n",
       "      <td>17.0</td>\n",
       "      <td>0.0</td>\n",
       "      <td>0.0</td>\n",
       "      <td>0.0</td>\n",
       "      <td>36</td>\n",
       "      <td>23</td>\n",
       "      <td>5</td>\n",
       "      <td>14</td>\n",
       "      <td>1</td>\n",
       "      <td>0</td>\n",
       "      <td>25.6</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>6362</th>\n",
       "      <td>5583.0</td>\n",
       "      <td>Hubei</td>\n",
       "      <td>China</td>\n",
       "      <td>30.9756</td>\n",
       "      <td>112.2707</td>\n",
       "      <td>2020-01-24</td>\n",
       "      <td>549.0</td>\n",
       "      <td>24.0</td>\n",
       "      <td>NaN</td>\n",
       "      <td>China/Hubei</td>\n",
       "      <td>24</td>\n",
       "      <td>105</td>\n",
       "      <td>7</td>\n",
       "      <td>0.0</td>\n",
       "      <td>0.0</td>\n",
       "      <td>0.0</td>\n",
       "      <td>0.0</td>\n",
       "      <td>0.0</td>\n",
       "      <td>0.0</td>\n",
       "      <td>0.0</td>\n",
       "      <td>0.0</td>\n",
       "      <td>37</td>\n",
       "      <td>24</td>\n",
       "      <td>6</td>\n",
       "      <td>15</td>\n",
       "      <td>2</td>\n",
       "      <td>0</td>\n",
       "      <td>25.6</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>6363</th>\n",
       "      <td>5584.0</td>\n",
       "      <td>Hubei</td>\n",
       "      <td>China</td>\n",
       "      <td>30.9756</td>\n",
       "      <td>112.2707</td>\n",
       "      <td>2020-01-25</td>\n",
       "      <td>761.0</td>\n",
       "      <td>40.0</td>\n",
       "      <td>NaN</td>\n",
       "      <td>China/Hubei</td>\n",
       "      <td>25</td>\n",
       "      <td>212</td>\n",
       "      <td>16</td>\n",
       "      <td>105.0</td>\n",
       "      <td>0.0</td>\n",
       "      <td>0.0</td>\n",
       "      <td>0.0</td>\n",
       "      <td>7.0</td>\n",
       "      <td>0.0</td>\n",
       "      <td>0.0</td>\n",
       "      <td>0.0</td>\n",
       "      <td>38</td>\n",
       "      <td>25</td>\n",
       "      <td>7</td>\n",
       "      <td>16</td>\n",
       "      <td>3</td>\n",
       "      <td>0</td>\n",
       "      <td>25.6</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>6364</th>\n",
       "      <td>5585.0</td>\n",
       "      <td>Hubei</td>\n",
       "      <td>China</td>\n",
       "      <td>30.9756</td>\n",
       "      <td>112.2707</td>\n",
       "      <td>2020-01-26</td>\n",
       "      <td>1058.0</td>\n",
       "      <td>52.0</td>\n",
       "      <td>NaN</td>\n",
       "      <td>China/Hubei</td>\n",
       "      <td>26</td>\n",
       "      <td>297</td>\n",
       "      <td>12</td>\n",
       "      <td>212.0</td>\n",
       "      <td>0.0</td>\n",
       "      <td>0.0</td>\n",
       "      <td>0.0</td>\n",
       "      <td>16.0</td>\n",
       "      <td>0.0</td>\n",
       "      <td>0.0</td>\n",
       "      <td>0.0</td>\n",
       "      <td>39</td>\n",
       "      <td>26</td>\n",
       "      <td>8</td>\n",
       "      <td>17</td>\n",
       "      <td>4</td>\n",
       "      <td>0</td>\n",
       "      <td>25.6</td>\n",
       "    </tr>\n",
       "  </tbody>\n",
       "</table>\n",
       "</div>"
      ],
      "text/plain": [
       "          Id Province/State Country/Region      Lat      Long       Date  \\\n",
       "6360  5581.0          Hubei          China  30.9756  112.2707 2020-01-22   \n",
       "6361  5582.0          Hubei          China  30.9756  112.2707 2020-01-23   \n",
       "6362  5583.0          Hubei          China  30.9756  112.2707 2020-01-24   \n",
       "6363  5584.0          Hubei          China  30.9756  112.2707 2020-01-25   \n",
       "6364  5585.0          Hubei          China  30.9756  112.2707 2020-01-26   \n",
       "\n",
       "      ConfirmedCases  Fatalities  ForecastId     place_id  day  cases/day  \\\n",
       "6360           444.0        17.0         NaN  China/Hubei   22        444   \n",
       "6361           444.0        17.0         NaN  China/Hubei   23          0   \n",
       "6362           549.0        24.0         NaN  China/Hubei   24        105   \n",
       "6363           761.0        40.0         NaN  China/Hubei   25        212   \n",
       "6364          1058.0        52.0         NaN  China/Hubei   26        297   \n",
       "\n",
       "      fatal/day  cases/day-(1-1)  cases/day-(1-7)  cases/day-(8-14)  \\\n",
       "6360         17              0.0              0.0               0.0   \n",
       "6361          0            444.0              0.0               0.0   \n",
       "6362          7              0.0              0.0               0.0   \n",
       "6363         16            105.0              0.0               0.0   \n",
       "6364         12            212.0              0.0               0.0   \n",
       "\n",
       "      cases/day-(15-21)  fatal/day-(1-1)  fatal/day-(1-7)  fatal/day-(8-14)  \\\n",
       "6360                0.0              0.0              0.0               0.0   \n",
       "6361                0.0             17.0              0.0               0.0   \n",
       "6362                0.0              0.0              0.0               0.0   \n",
       "6363                0.0              7.0              0.0               0.0   \n",
       "6364                0.0             16.0              0.0               0.0   \n",
       "\n",
       "      fatal/day-(15-21)  days_since_1cases  days_since_10cases  \\\n",
       "6360                0.0                 35                  22   \n",
       "6361                0.0                 36                  23   \n",
       "6362                0.0                 37                  24   \n",
       "6363                0.0                 38                  25   \n",
       "6364                0.0                 39                  26   \n",
       "\n",
       "      days_since_100cases  days_since_1fatal  days_since_10fatal  \\\n",
       "6360                    4                 13                   0   \n",
       "6361                    5                 14                   1   \n",
       "6362                    6                 15                   2   \n",
       "6363                    7                 16                   3   \n",
       "6364                    8                 17                   4   \n",
       "\n",
       "      days_since_100fatal  SmokingRate  \n",
       "6360                    0         25.6  \n",
       "6361                    0         25.6  \n",
       "6362                    0         25.6  \n",
       "6363                    0         25.6  \n",
       "6364                    0         25.6  "
      ]
     },
     "execution_count": 57,
     "metadata": {},
     "output_type": "execute_result"
    }
   ],
   "source": [
    "df_traintest4[df_traintest4[\"place_id\"]==\"China/Hubei\"].head()"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 48,
   "metadata": {},
   "outputs": [],
   "source": [
    "#######################用世界平均吸烟率去代替空缺的吸烟率"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 58,
   "metadata": {},
   "outputs": [
    {
     "name": "stderr",
     "output_type": "stream",
     "text": [
      "F:\\Anaconda\\lib\\site-packages\\ipykernel_launcher.py:2: SettingWithCopyWarning: \n",
      "A value is trying to be set on a copy of a slice from a DataFrame\n",
      "\n",
      "See the caveats in the documentation: https://pandas.pydata.org/pandas-docs/stable/user_guide/indexing.html#returning-a-view-versus-a-copy\n",
      "  \n"
     ]
    },
    {
     "data": {
      "text/html": [
       "<div>\n",
       "<style scoped>\n",
       "    .dataframe tbody tr th:only-of-type {\n",
       "        vertical-align: middle;\n",
       "    }\n",
       "\n",
       "    .dataframe tbody tr th {\n",
       "        vertical-align: top;\n",
       "    }\n",
       "\n",
       "    .dataframe thead th {\n",
       "        text-align: right;\n",
       "    }\n",
       "</style>\n",
       "<table border=\"1\" class=\"dataframe\">\n",
       "  <thead>\n",
       "    <tr style=\"text-align: right;\">\n",
       "      <th></th>\n",
       "      <th>Id</th>\n",
       "      <th>Province/State</th>\n",
       "      <th>Country/Region</th>\n",
       "      <th>Lat</th>\n",
       "      <th>Long</th>\n",
       "      <th>Date</th>\n",
       "      <th>ConfirmedCases</th>\n",
       "      <th>Fatalities</th>\n",
       "      <th>ForecastId</th>\n",
       "      <th>place_id</th>\n",
       "      <th>day</th>\n",
       "      <th>cases/day</th>\n",
       "      <th>fatal/day</th>\n",
       "      <th>cases/day-(1-1)</th>\n",
       "      <th>cases/day-(1-7)</th>\n",
       "      <th>cases/day-(8-14)</th>\n",
       "      <th>cases/day-(15-21)</th>\n",
       "      <th>fatal/day-(1-1)</th>\n",
       "      <th>fatal/day-(1-7)</th>\n",
       "      <th>fatal/day-(8-14)</th>\n",
       "      <th>fatal/day-(15-21)</th>\n",
       "      <th>days_since_1cases</th>\n",
       "      <th>days_since_10cases</th>\n",
       "      <th>days_since_100cases</th>\n",
       "      <th>days_since_1fatal</th>\n",
       "      <th>days_since_10fatal</th>\n",
       "      <th>days_since_100fatal</th>\n",
       "      <th>SmokingRate</th>\n",
       "    </tr>\n",
       "  </thead>\n",
       "  <tbody>\n",
       "    <tr>\n",
       "      <th>0</th>\n",
       "      <td>1.0</td>\n",
       "      <td>NaN</td>\n",
       "      <td>Afghanistan</td>\n",
       "      <td>33.0</td>\n",
       "      <td>65.0</td>\n",
       "      <td>2020-01-22</td>\n",
       "      <td>0.0</td>\n",
       "      <td>0.0</td>\n",
       "      <td>NaN</td>\n",
       "      <td>Afghanistan</td>\n",
       "      <td>22</td>\n",
       "      <td>0</td>\n",
       "      <td>0</td>\n",
       "      <td>0.0</td>\n",
       "      <td>0.0</td>\n",
       "      <td>0.0</td>\n",
       "      <td>0.0</td>\n",
       "      <td>0.0</td>\n",
       "      <td>0.0</td>\n",
       "      <td>0.0</td>\n",
       "      <td>0.0</td>\n",
       "      <td>0</td>\n",
       "      <td>0</td>\n",
       "      <td>0</td>\n",
       "      <td>0</td>\n",
       "      <td>0</td>\n",
       "      <td>0</td>\n",
       "      <td>20.475517</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>1</th>\n",
       "      <td>2.0</td>\n",
       "      <td>NaN</td>\n",
       "      <td>Afghanistan</td>\n",
       "      <td>33.0</td>\n",
       "      <td>65.0</td>\n",
       "      <td>2020-01-23</td>\n",
       "      <td>0.0</td>\n",
       "      <td>0.0</td>\n",
       "      <td>NaN</td>\n",
       "      <td>Afghanistan</td>\n",
       "      <td>23</td>\n",
       "      <td>0</td>\n",
       "      <td>0</td>\n",
       "      <td>0.0</td>\n",
       "      <td>0.0</td>\n",
       "      <td>0.0</td>\n",
       "      <td>0.0</td>\n",
       "      <td>0.0</td>\n",
       "      <td>0.0</td>\n",
       "      <td>0.0</td>\n",
       "      <td>0.0</td>\n",
       "      <td>0</td>\n",
       "      <td>0</td>\n",
       "      <td>0</td>\n",
       "      <td>0</td>\n",
       "      <td>0</td>\n",
       "      <td>0</td>\n",
       "      <td>20.475517</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>2</th>\n",
       "      <td>3.0</td>\n",
       "      <td>NaN</td>\n",
       "      <td>Afghanistan</td>\n",
       "      <td>33.0</td>\n",
       "      <td>65.0</td>\n",
       "      <td>2020-01-24</td>\n",
       "      <td>0.0</td>\n",
       "      <td>0.0</td>\n",
       "      <td>NaN</td>\n",
       "      <td>Afghanistan</td>\n",
       "      <td>24</td>\n",
       "      <td>0</td>\n",
       "      <td>0</td>\n",
       "      <td>0.0</td>\n",
       "      <td>0.0</td>\n",
       "      <td>0.0</td>\n",
       "      <td>0.0</td>\n",
       "      <td>0.0</td>\n",
       "      <td>0.0</td>\n",
       "      <td>0.0</td>\n",
       "      <td>0.0</td>\n",
       "      <td>0</td>\n",
       "      <td>0</td>\n",
       "      <td>0</td>\n",
       "      <td>0</td>\n",
       "      <td>0</td>\n",
       "      <td>0</td>\n",
       "      <td>20.475517</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>3</th>\n",
       "      <td>4.0</td>\n",
       "      <td>NaN</td>\n",
       "      <td>Afghanistan</td>\n",
       "      <td>33.0</td>\n",
       "      <td>65.0</td>\n",
       "      <td>2020-01-25</td>\n",
       "      <td>0.0</td>\n",
       "      <td>0.0</td>\n",
       "      <td>NaN</td>\n",
       "      <td>Afghanistan</td>\n",
       "      <td>25</td>\n",
       "      <td>0</td>\n",
       "      <td>0</td>\n",
       "      <td>0.0</td>\n",
       "      <td>0.0</td>\n",
       "      <td>0.0</td>\n",
       "      <td>0.0</td>\n",
       "      <td>0.0</td>\n",
       "      <td>0.0</td>\n",
       "      <td>0.0</td>\n",
       "      <td>0.0</td>\n",
       "      <td>0</td>\n",
       "      <td>0</td>\n",
       "      <td>0</td>\n",
       "      <td>0</td>\n",
       "      <td>0</td>\n",
       "      <td>0</td>\n",
       "      <td>20.475517</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>4</th>\n",
       "      <td>5.0</td>\n",
       "      <td>NaN</td>\n",
       "      <td>Afghanistan</td>\n",
       "      <td>33.0</td>\n",
       "      <td>65.0</td>\n",
       "      <td>2020-01-26</td>\n",
       "      <td>0.0</td>\n",
       "      <td>0.0</td>\n",
       "      <td>NaN</td>\n",
       "      <td>Afghanistan</td>\n",
       "      <td>26</td>\n",
       "      <td>0</td>\n",
       "      <td>0</td>\n",
       "      <td>0.0</td>\n",
       "      <td>0.0</td>\n",
       "      <td>0.0</td>\n",
       "      <td>0.0</td>\n",
       "      <td>0.0</td>\n",
       "      <td>0.0</td>\n",
       "      <td>0.0</td>\n",
       "      <td>0.0</td>\n",
       "      <td>0</td>\n",
       "      <td>0</td>\n",
       "      <td>0</td>\n",
       "      <td>0</td>\n",
       "      <td>0</td>\n",
       "      <td>0</td>\n",
       "      <td>20.475517</td>\n",
       "    </tr>\n",
       "  </tbody>\n",
       "</table>\n",
       "</div>"
      ],
      "text/plain": [
       "    Id Province/State Country/Region   Lat  Long       Date  ConfirmedCases  \\\n",
       "0  1.0            NaN    Afghanistan  33.0  65.0 2020-01-22             0.0   \n",
       "1  2.0            NaN    Afghanistan  33.0  65.0 2020-01-23             0.0   \n",
       "2  3.0            NaN    Afghanistan  33.0  65.0 2020-01-24             0.0   \n",
       "3  4.0            NaN    Afghanistan  33.0  65.0 2020-01-25             0.0   \n",
       "4  5.0            NaN    Afghanistan  33.0  65.0 2020-01-26             0.0   \n",
       "\n",
       "   Fatalities  ForecastId     place_id  day  cases/day  fatal/day  \\\n",
       "0         0.0         NaN  Afghanistan   22          0          0   \n",
       "1         0.0         NaN  Afghanistan   23          0          0   \n",
       "2         0.0         NaN  Afghanistan   24          0          0   \n",
       "3         0.0         NaN  Afghanistan   25          0          0   \n",
       "4         0.0         NaN  Afghanistan   26          0          0   \n",
       "\n",
       "   cases/day-(1-1)  cases/day-(1-7)  cases/day-(8-14)  cases/day-(15-21)  \\\n",
       "0              0.0              0.0               0.0                0.0   \n",
       "1              0.0              0.0               0.0                0.0   \n",
       "2              0.0              0.0               0.0                0.0   \n",
       "3              0.0              0.0               0.0                0.0   \n",
       "4              0.0              0.0               0.0                0.0   \n",
       "\n",
       "   fatal/day-(1-1)  fatal/day-(1-7)  fatal/day-(8-14)  fatal/day-(15-21)  \\\n",
       "0              0.0              0.0               0.0                0.0   \n",
       "1              0.0              0.0               0.0                0.0   \n",
       "2              0.0              0.0               0.0                0.0   \n",
       "3              0.0              0.0               0.0                0.0   \n",
       "4              0.0              0.0               0.0                0.0   \n",
       "\n",
       "   days_since_1cases  days_since_10cases  days_since_100cases  \\\n",
       "0                  0                   0                    0   \n",
       "1                  0                   0                    0   \n",
       "2                  0                   0                    0   \n",
       "3                  0                   0                    0   \n",
       "4                  0                   0                    0   \n",
       "\n",
       "   days_since_1fatal  days_since_10fatal  days_since_100fatal  SmokingRate  \n",
       "0                  0                   0                    0    20.475517  \n",
       "1                  0                   0                    0    20.475517  \n",
       "2                  0                   0                    0    20.475517  \n",
       "3                  0                   0                    0    20.475517  \n",
       "4                  0                   0                    0    20.475517  "
      ]
     },
     "execution_count": 58,
     "metadata": {},
     "output_type": "execute_result"
    }
   ],
   "source": [
    "SmokingRate=df_smoking_recent[\"SmokingRate\"][df_smoking_recent[\"Entity\"]==\"World\"].values[0]\n",
    "df_traintest4[\"SmokingRate\"][pd.isna(df_traintest4[\"SmokingRate\"])]=SmokingRate\n",
    "df_traintest4.head()"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 50,
   "metadata": {},
   "outputs": [],
   "source": [
    "#################接着引入同样感兴趣的的各国各地区的经济数据：World Economic Outlook Database，世界经济情况展示数据库\n",
    "#################该组织有国家以及国家群为粒度的数据,选择下载国家数据\n",
    "#################https://www.imf.org/external/pubs/ft/weo/2017/01/weodata/index.aspx"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 59,
   "metadata": {},
   "outputs": [],
   "source": [
    "smoke_path=r\"F:\\kaggle\\covid-first\\WEO.csv\""
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 60,
   "metadata": {},
   "outputs": [],
   "source": [
    "df_weo=pd.read_csv(smoke_path)"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 61,
   "metadata": {},
   "outputs": [
    {
     "data": {
      "text/html": [
       "<div>\n",
       "<style scoped>\n",
       "    .dataframe tbody tr th:only-of-type {\n",
       "        vertical-align: middle;\n",
       "    }\n",
       "\n",
       "    .dataframe tbody tr th {\n",
       "        vertical-align: top;\n",
       "    }\n",
       "\n",
       "    .dataframe thead th {\n",
       "        text-align: right;\n",
       "    }\n",
       "</style>\n",
       "<table border=\"1\" class=\"dataframe\">\n",
       "  <thead>\n",
       "    <tr style=\"text-align: right;\">\n",
       "      <th></th>\n",
       "      <th>Country</th>\n",
       "      <th>Subject Descriptor</th>\n",
       "      <th>Units</th>\n",
       "      <th>Scale</th>\n",
       "      <th>Country/Series-specific Notes</th>\n",
       "      <th>2015</th>\n",
       "      <th>2016</th>\n",
       "      <th>2017</th>\n",
       "      <th>2018</th>\n",
       "      <th>2019</th>\n",
       "      <th>2020</th>\n",
       "      <th>2021</th>\n",
       "      <th>2022</th>\n",
       "      <th>Estimates Start After</th>\n",
       "    </tr>\n",
       "  </thead>\n",
       "  <tbody>\n",
       "    <tr>\n",
       "      <th>0</th>\n",
       "      <td>Afghanistan</td>\n",
       "      <td>Gross domestic product, constant prices</td>\n",
       "      <td>National currency</td>\n",
       "      <td>Billions</td>\n",
       "      <td>Source: National Statistics Office Latest actu...</td>\n",
       "      <td>467.035</td>\n",
       "      <td>476.376</td>\n",
       "      <td>490.667</td>\n",
       "      <td>507.84</td>\n",
       "      <td>528.154</td>\n",
       "      <td>551.921</td>\n",
       "      <td>579.517</td>\n",
       "      <td>611.39</td>\n",
       "      <td>2014.0</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>1</th>\n",
       "      <td>Afghanistan</td>\n",
       "      <td>Gross domestic product, constant prices</td>\n",
       "      <td>Percent change</td>\n",
       "      <td>NaN</td>\n",
       "      <td>See notes for:  Gross domestic product, consta...</td>\n",
       "      <td>0.758</td>\n",
       "      <td>2</td>\n",
       "      <td>3</td>\n",
       "      <td>3.5</td>\n",
       "      <td>4</td>\n",
       "      <td>4.5</td>\n",
       "      <td>5</td>\n",
       "      <td>5.5</td>\n",
       "      <td>2014.0</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>2</th>\n",
       "      <td>Afghanistan</td>\n",
       "      <td>Gross domestic product, current prices</td>\n",
       "      <td>National currency</td>\n",
       "      <td>Billions</td>\n",
       "      <td>Source: National Statistics Office Latest actu...</td>\n",
       "      <td>1,203.67</td>\n",
       "      <td>1,281.66</td>\n",
       "      <td>1,399.43</td>\n",
       "      <td>1,535.31</td>\n",
       "      <td>1,692.57</td>\n",
       "      <td>1,874.47</td>\n",
       "      <td>2,085.38</td>\n",
       "      <td>2,330.54</td>\n",
       "      <td>2014.0</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>3</th>\n",
       "      <td>Afghanistan</td>\n",
       "      <td>Gross domestic product, current prices</td>\n",
       "      <td>U.S. dollars</td>\n",
       "      <td>Billions</td>\n",
       "      <td>See notes for:  Gross domestic product, curren...</td>\n",
       "      <td>19.687</td>\n",
       "      <td>18.886</td>\n",
       "      <td>20.57</td>\n",
       "      <td>21.706</td>\n",
       "      <td>23.233</td>\n",
       "      <td>24.93</td>\n",
       "      <td>26.857</td>\n",
       "      <td>29.113</td>\n",
       "      <td>2014.0</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>4</th>\n",
       "      <td>Afghanistan</td>\n",
       "      <td>Gross domestic product, deflator</td>\n",
       "      <td>Index</td>\n",
       "      <td>NaN</td>\n",
       "      <td>See notes for:  Gross domestic product, consta...</td>\n",
       "      <td>257.726</td>\n",
       "      <td>269.044</td>\n",
       "      <td>285.209</td>\n",
       "      <td>302.321</td>\n",
       "      <td>320.469</td>\n",
       "      <td>339.627</td>\n",
       "      <td>359.848</td>\n",
       "      <td>381.188</td>\n",
       "      <td>2014.0</td>\n",
       "    </tr>\n",
       "  </tbody>\n",
       "</table>\n",
       "</div>"
      ],
      "text/plain": [
       "       Country                       Subject Descriptor              Units  \\\n",
       "0  Afghanistan  Gross domestic product, constant prices  National currency   \n",
       "1  Afghanistan  Gross domestic product, constant prices     Percent change   \n",
       "2  Afghanistan   Gross domestic product, current prices  National currency   \n",
       "3  Afghanistan   Gross domestic product, current prices       U.S. dollars   \n",
       "4  Afghanistan         Gross domestic product, deflator              Index   \n",
       "\n",
       "      Scale                      Country/Series-specific Notes      2015  \\\n",
       "0  Billions  Source: National Statistics Office Latest actu...   467.035   \n",
       "1       NaN  See notes for:  Gross domestic product, consta...     0.758   \n",
       "2  Billions  Source: National Statistics Office Latest actu...  1,203.67   \n",
       "3  Billions  See notes for:  Gross domestic product, curren...    19.687   \n",
       "4       NaN  See notes for:  Gross domestic product, consta...   257.726   \n",
       "\n",
       "       2016      2017      2018      2019      2020      2021      2022  \\\n",
       "0   476.376   490.667    507.84   528.154   551.921   579.517    611.39   \n",
       "1         2         3       3.5         4       4.5         5       5.5   \n",
       "2  1,281.66  1,399.43  1,535.31  1,692.57  1,874.47  2,085.38  2,330.54   \n",
       "3    18.886     20.57    21.706    23.233     24.93    26.857    29.113   \n",
       "4   269.044   285.209   302.321   320.469   339.627   359.848   381.188   \n",
       "\n",
       "   Estimates Start After  \n",
       "0                 2014.0  \n",
       "1                 2014.0  \n",
       "2                 2014.0  \n",
       "3                 2014.0  \n",
       "4                 2014.0  "
      ]
     },
     "execution_count": 61,
     "metadata": {},
     "output_type": "execute_result"
    }
   ],
   "source": [
    "df_weo.head()        #############每个地区都拥有不同的经济指标"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 62,
   "metadata": {},
   "outputs": [
    {
     "name": "stdout",
     "output_type": "stream",
     "text": [
      "['Gross domestic product, constant prices'\n",
      " 'Gross domestic product, current prices'\n",
      " 'Gross domestic product, deflator'\n",
      " 'Gross domestic product per capita, constant prices'\n",
      " 'Gross domestic product per capita, current prices'\n",
      " 'Output gap in percent of potential GDP'\n",
      " 'Gross domestic product based on purchasing-power-parity (PPP) valuation of country GDP'\n",
      " 'Gross domestic product based on purchasing-power-parity (PPP) per capita GDP'\n",
      " 'Gross domestic product based on purchasing-power-parity (PPP) share of world total'\n",
      " 'Implied PPP conversion rate' 'Total investment' 'Gross national savings'\n",
      " 'Inflation, average consumer prices'\n",
      " 'Inflation, end of period consumer prices'\n",
      " 'Six-month London interbank offered rate (LIBOR)'\n",
      " 'Volume of imports of goods and services' 'Volume of Imports of goods'\n",
      " 'Volume of exports of goods and services' 'Volume of exports of goods'\n",
      " 'Unemployment rate' 'Employment' 'Population'\n",
      " 'General government revenue' 'General government total expenditure'\n",
      " 'General government net lending/borrowing'\n",
      " 'General government structural balance'\n",
      " 'General government primary net lending/borrowing'\n",
      " 'General government net debt' 'General government gross debt'\n",
      " 'Gross domestic product corresponding to fiscal year, current prices'\n",
      " 'Current account balance' nan]\n"
     ]
    }
   ],
   "source": [
    "print(df_weo['Subject Descriptor'].unique())\n",
    "##解释几个排在前面的变量：\n",
    "##'Gross domestic product, constant prices'  考虑了通货膨胀的国内净生产总值≈GDP\n",
    "##'Gross domestic product, current prices'   国内净生产总值≈GDP\n",
    "##'Gross domestic product, deflator'         通货紧缩指数，发展趋势的数据\n",
    "##'Gross domestic product per capita, constant prices' ####按人口平均计算的本地生产总值\n",
    "##'Gross domestic product per capita, current prices'  ####按人口平均计算的本地生产总值"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 63,
   "metadata": {
    "scrolled": true
   },
   "outputs": [
    {
     "data": {
      "text/html": [
       "<div>\n",
       "<style scoped>\n",
       "    .dataframe tbody tr th:only-of-type {\n",
       "        vertical-align: middle;\n",
       "    }\n",
       "\n",
       "    .dataframe tbody tr th {\n",
       "        vertical-align: top;\n",
       "    }\n",
       "\n",
       "    .dataframe thead th {\n",
       "        text-align: right;\n",
       "    }\n",
       "</style>\n",
       "<table border=\"1\" class=\"dataframe\">\n",
       "  <thead>\n",
       "    <tr style=\"text-align: right;\">\n",
       "      <th></th>\n",
       "      <th>Country</th>\n",
       "      <th>Gross_domestic_product__constant_prices</th>\n",
       "      <th>Gross_domestic_product__current_prices</th>\n",
       "      <th>Gross_domestic_product__deflator</th>\n",
       "      <th>Gross_domestic_product_per_capita__constant_prices</th>\n",
       "      <th>Gross_domestic_product_per_capita__current_prices</th>\n",
       "      <th>Output_gap_in_percent_of_potential_GDP</th>\n",
       "      <th>Gross_domestic_product_based_on_purchasing_power_parity__PPP__valuation_of_country_GDP</th>\n",
       "      <th>Gross_domestic_product_based_on_purchasing_power_parity__PPP__per_capita_GDP</th>\n",
       "      <th>Gross_domestic_product_based_on_purchasing_power_parity__PPP__share_of_world_total</th>\n",
       "      <th>Implied_PPP_conversion_rate</th>\n",
       "      <th>Total_investment</th>\n",
       "      <th>Gross_national_savings</th>\n",
       "      <th>Inflation__average_consumer_prices</th>\n",
       "      <th>Inflation__end_of_period_consumer_prices</th>\n",
       "      <th>Six_month_London_interbank_offered_rate__LIBOR_</th>\n",
       "      <th>Volume_of_imports_of_goods_and_services</th>\n",
       "      <th>Volume_of_Imports_of_goods</th>\n",
       "      <th>Volume_of_exports_of_goods_and_services</th>\n",
       "      <th>Volume_of_exports_of_goods</th>\n",
       "      <th>Unemployment_rate</th>\n",
       "      <th>Employment</th>\n",
       "      <th>Population</th>\n",
       "      <th>General_government_revenue</th>\n",
       "      <th>General_government_total_expenditure</th>\n",
       "      <th>General_government_net_lending_borrowing</th>\n",
       "      <th>General_government_structural_balance</th>\n",
       "      <th>General_government_primary_net_lending_borrowing</th>\n",
       "      <th>General_government_net_debt</th>\n",
       "      <th>General_government_gross_debt</th>\n",
       "      <th>Gross_domestic_product_corresponding_to_fiscal_year__current_prices</th>\n",
       "      <th>Current_account_balance</th>\n",
       "      <th>Country/Region</th>\n",
       "    </tr>\n",
       "  </thead>\n",
       "  <tbody>\n",
       "    <tr>\n",
       "      <th>0</th>\n",
       "      <td>Afghanistan</td>\n",
       "      <td>528.154</td>\n",
       "      <td>1,692.57</td>\n",
       "      <td>320.469</td>\n",
       "      <td>14,300.19</td>\n",
       "      <td>45,827.64</td>\n",
       "      <td>NaN</td>\n",
       "      <td>75.87</td>\n",
       "      <td>2,054.23</td>\n",
       "      <td>0.053</td>\n",
       "      <td>22.309</td>\n",
       "      <td>18.346</td>\n",
       "      <td>20.174</td>\n",
       "      <td>124.809</td>\n",
       "      <td>131.29</td>\n",
       "      <td>NaN</td>\n",
       "      <td>3.559</td>\n",
       "      <td>2.773</td>\n",
       "      <td>13.252</td>\n",
       "      <td>17.026</td>\n",
       "      <td>NaN</td>\n",
       "      <td>NaN</td>\n",
       "      <td>36.933</td>\n",
       "      <td>469.79</td>\n",
       "      <td>467.62</td>\n",
       "      <td>2.17</td>\n",
       "      <td>NaN</td>\n",
       "      <td>2.532</td>\n",
       "      <td>NaN</td>\n",
       "      <td>101.669</td>\n",
       "      <td>1,692.57</td>\n",
       "      <td>0.425</td>\n",
       "      <td>Afghanistan</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>1</th>\n",
       "      <td>Albania</td>\n",
       "      <td>858.595</td>\n",
       "      <td>1,841.87</td>\n",
       "      <td>214.522</td>\n",
       "      <td>299,027.69</td>\n",
       "      <td>641,479.81</td>\n",
       "      <td>NaN</td>\n",
       "      <td>40.999</td>\n",
       "      <td>14,278.81</td>\n",
       "      <td>0.029</td>\n",
       "      <td>44.925</td>\n",
       "      <td>26.646</td>\n",
       "      <td>14.854</td>\n",
       "      <td>130.977</td>\n",
       "      <td>132.641</td>\n",
       "      <td>NaN</td>\n",
       "      <td>2.479</td>\n",
       "      <td>0.836</td>\n",
       "      <td>4.043</td>\n",
       "      <td>4.242</td>\n",
       "      <td>15.35</td>\n",
       "      <td>NaN</td>\n",
       "      <td>2.871</td>\n",
       "      <td>492.277</td>\n",
       "      <td>537.234</td>\n",
       "      <td>-44.957</td>\n",
       "      <td>NaN</td>\n",
       "      <td>-6.302</td>\n",
       "      <td>1,113.30</td>\n",
       "      <td>1,113.30</td>\n",
       "      <td>1,841.87</td>\n",
       "      <td>-1.632</td>\n",
       "      <td>Albania</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>2</th>\n",
       "      <td>Algeria</td>\n",
       "      <td>7,583.96</td>\n",
       "      <td>21,125.43</td>\n",
       "      <td>278.554</td>\n",
       "      <td>176,011.62</td>\n",
       "      <td>490,287.91</td>\n",
       "      <td>NaN</td>\n",
       "      <td>675.691</td>\n",
       "      <td>15,681.72</td>\n",
       "      <td>0.475</td>\n",
       "      <td>31.265</td>\n",
       "      <td>38.873</td>\n",
       "      <td>29.337</td>\n",
       "      <td>208.827</td>\n",
       "      <td>211.975</td>\n",
       "      <td>NaN</td>\n",
       "      <td>-2.309</td>\n",
       "      <td>-2.309</td>\n",
       "      <td>1.649</td>\n",
       "      <td>1.79</td>\n",
       "      <td>14.521</td>\n",
       "      <td>NaN</td>\n",
       "      <td>43.088</td>\n",
       "      <td>6,365.52</td>\n",
       "      <td>6,550.00</td>\n",
       "      <td>-184.478</td>\n",
       "      <td>NaN</td>\n",
       "      <td>-287.307</td>\n",
       "      <td>3,710.77</td>\n",
       "      <td>3,710.77</td>\n",
       "      <td>21,125.43</td>\n",
       "      <td>-17.345</td>\n",
       "      <td>Algeria</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>3</th>\n",
       "      <td>Angola</td>\n",
       "      <td>1,760.49</td>\n",
       "      <td>27,359.28</td>\n",
       "      <td>1,554.07</td>\n",
       "      <td>58,886.08</td>\n",
       "      <td>915,131.64</td>\n",
       "      <td>NaN</td>\n",
       "      <td>208.583</td>\n",
       "      <td>6,976.84</td>\n",
       "      <td>0.147</td>\n",
       "      <td>131.167</td>\n",
       "      <td>7.284</td>\n",
       "      <td>3.555</td>\n",
       "      <td>337.704</td>\n",
       "      <td>355.519</td>\n",
       "      <td>NaN</td>\n",
       "      <td>1.543</td>\n",
       "      <td>1.556</td>\n",
       "      <td>0.424</td>\n",
       "      <td>0.186</td>\n",
       "      <td>NaN</td>\n",
       "      <td>NaN</td>\n",
       "      <td>29.897</td>\n",
       "      <td>5,304.57</td>\n",
       "      <td>6,265.99</td>\n",
       "      <td>-961.422</td>\n",
       "      <td>NaN</td>\n",
       "      <td>-54.413</td>\n",
       "      <td>NaN</td>\n",
       "      <td>17,195.39</td>\n",
       "      <td>27,359.28</td>\n",
       "      <td>-5.153</td>\n",
       "      <td>Angola</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>4</th>\n",
       "      <td>Antigua and Barbuda</td>\n",
       "      <td>2.919</td>\n",
       "      <td>4.26</td>\n",
       "      <td>145.942</td>\n",
       "      <td>31,317.40</td>\n",
       "      <td>45,705.31</td>\n",
       "      <td>NaN</td>\n",
       "      <td>2.563</td>\n",
       "      <td>27,500.00</td>\n",
       "      <td>0.002</td>\n",
       "      <td>1.662</td>\n",
       "      <td>NaN</td>\n",
       "      <td>15.336</td>\n",
       "      <td>143.235</td>\n",
       "      <td>144.893</td>\n",
       "      <td>NaN</td>\n",
       "      <td>0.777</td>\n",
       "      <td>1.7</td>\n",
       "      <td>2.386</td>\n",
       "      <td>1.665</td>\n",
       "      <td>NaN</td>\n",
       "      <td>NaN</td>\n",
       "      <td>0.093</td>\n",
       "      <td>0.921</td>\n",
       "      <td>0.905</td>\n",
       "      <td>0.017</td>\n",
       "      <td>NaN</td>\n",
       "      <td>0.126</td>\n",
       "      <td>NaN</td>\n",
       "      <td>3.595</td>\n",
       "      <td>4.26</td>\n",
       "      <td>-0.152</td>\n",
       "      <td>Antigua and Barbuda</td>\n",
       "    </tr>\n",
       "  </tbody>\n",
       "</table>\n",
       "</div>"
      ],
      "text/plain": [
       "               Country Gross_domestic_product__constant_prices  \\\n",
       "0          Afghanistan                                 528.154   \n",
       "1              Albania                                 858.595   \n",
       "2              Algeria                                7,583.96   \n",
       "3               Angola                                1,760.49   \n",
       "4  Antigua and Barbuda                                   2.919   \n",
       "\n",
       "  Gross_domestic_product__current_prices Gross_domestic_product__deflator  \\\n",
       "0                               1,692.57                          320.469   \n",
       "1                               1,841.87                          214.522   \n",
       "2                              21,125.43                          278.554   \n",
       "3                              27,359.28                         1,554.07   \n",
       "4                                   4.26                          145.942   \n",
       "\n",
       "  Gross_domestic_product_per_capita__constant_prices  \\\n",
       "0                                          14,300.19   \n",
       "1                                         299,027.69   \n",
       "2                                         176,011.62   \n",
       "3                                          58,886.08   \n",
       "4                                          31,317.40   \n",
       "\n",
       "  Gross_domestic_product_per_capita__current_prices  \\\n",
       "0                                         45,827.64   \n",
       "1                                        641,479.81   \n",
       "2                                        490,287.91   \n",
       "3                                        915,131.64   \n",
       "4                                         45,705.31   \n",
       "\n",
       "  Output_gap_in_percent_of_potential_GDP  \\\n",
       "0                                    NaN   \n",
       "1                                    NaN   \n",
       "2                                    NaN   \n",
       "3                                    NaN   \n",
       "4                                    NaN   \n",
       "\n",
       "  Gross_domestic_product_based_on_purchasing_power_parity__PPP__valuation_of_country_GDP  \\\n",
       "0                                              75.87                                       \n",
       "1                                             40.999                                       \n",
       "2                                            675.691                                       \n",
       "3                                            208.583                                       \n",
       "4                                              2.563                                       \n",
       "\n",
       "  Gross_domestic_product_based_on_purchasing_power_parity__PPP__per_capita_GDP  \\\n",
       "0                                           2,054.23                             \n",
       "1                                          14,278.81                             \n",
       "2                                          15,681.72                             \n",
       "3                                           6,976.84                             \n",
       "4                                          27,500.00                             \n",
       "\n",
       "  Gross_domestic_product_based_on_purchasing_power_parity__PPP__share_of_world_total  \\\n",
       "0                                              0.053                                   \n",
       "1                                              0.029                                   \n",
       "2                                              0.475                                   \n",
       "3                                              0.147                                   \n",
       "4                                              0.002                                   \n",
       "\n",
       "  Implied_PPP_conversion_rate Total_investment Gross_national_savings  \\\n",
       "0                      22.309           18.346                 20.174   \n",
       "1                      44.925           26.646                 14.854   \n",
       "2                      31.265           38.873                 29.337   \n",
       "3                     131.167            7.284                  3.555   \n",
       "4                       1.662              NaN                 15.336   \n",
       "\n",
       "  Inflation__average_consumer_prices Inflation__end_of_period_consumer_prices  \\\n",
       "0                            124.809                                   131.29   \n",
       "1                            130.977                                  132.641   \n",
       "2                            208.827                                  211.975   \n",
       "3                            337.704                                  355.519   \n",
       "4                            143.235                                  144.893   \n",
       "\n",
       "  Six_month_London_interbank_offered_rate__LIBOR_  \\\n",
       "0                                             NaN   \n",
       "1                                             NaN   \n",
       "2                                             NaN   \n",
       "3                                             NaN   \n",
       "4                                             NaN   \n",
       "\n",
       "  Volume_of_imports_of_goods_and_services Volume_of_Imports_of_goods  \\\n",
       "0                                   3.559                      2.773   \n",
       "1                                   2.479                      0.836   \n",
       "2                                  -2.309                     -2.309   \n",
       "3                                   1.543                      1.556   \n",
       "4                                   0.777                        1.7   \n",
       "\n",
       "  Volume_of_exports_of_goods_and_services Volume_of_exports_of_goods  \\\n",
       "0                                  13.252                     17.026   \n",
       "1                                   4.043                      4.242   \n",
       "2                                   1.649                       1.79   \n",
       "3                                   0.424                      0.186   \n",
       "4                                   2.386                      1.665   \n",
       "\n",
       "  Unemployment_rate Employment Population General_government_revenue  \\\n",
       "0               NaN        NaN     36.933                     469.79   \n",
       "1             15.35        NaN      2.871                    492.277   \n",
       "2            14.521        NaN     43.088                   6,365.52   \n",
       "3               NaN        NaN     29.897                   5,304.57   \n",
       "4               NaN        NaN      0.093                      0.921   \n",
       "\n",
       "  General_government_total_expenditure  \\\n",
       "0                               467.62   \n",
       "1                              537.234   \n",
       "2                             6,550.00   \n",
       "3                             6,265.99   \n",
       "4                                0.905   \n",
       "\n",
       "  General_government_net_lending_borrowing  \\\n",
       "0                                     2.17   \n",
       "1                                  -44.957   \n",
       "2                                 -184.478   \n",
       "3                                 -961.422   \n",
       "4                                    0.017   \n",
       "\n",
       "  General_government_structural_balance  \\\n",
       "0                                   NaN   \n",
       "1                                   NaN   \n",
       "2                                   NaN   \n",
       "3                                   NaN   \n",
       "4                                   NaN   \n",
       "\n",
       "  General_government_primary_net_lending_borrowing  \\\n",
       "0                                            2.532   \n",
       "1                                           -6.302   \n",
       "2                                         -287.307   \n",
       "3                                          -54.413   \n",
       "4                                            0.126   \n",
       "\n",
       "  General_government_net_debt General_government_gross_debt  \\\n",
       "0                         NaN                       101.669   \n",
       "1                    1,113.30                      1,113.30   \n",
       "2                    3,710.77                      3,710.77   \n",
       "3                         NaN                     17,195.39   \n",
       "4                         NaN                         3.595   \n",
       "\n",
       "  Gross_domestic_product_corresponding_to_fiscal_year__current_prices  \\\n",
       "0                                           1,692.57                    \n",
       "1                                           1,841.87                    \n",
       "2                                          21,125.43                    \n",
       "3                                          27,359.28                    \n",
       "4                                               4.26                    \n",
       "\n",
       "  Current_account_balance       Country/Region  \n",
       "0                   0.425          Afghanistan  \n",
       "1                  -1.632              Albania  \n",
       "2                 -17.345              Algeria  \n",
       "3                  -5.153               Angola  \n",
       "4                  -0.152  Antigua and Barbuda  "
      ]
     },
     "execution_count": 63,
     "metadata": {},
     "output_type": "execute_result"
    }
   ],
   "source": [
    "subs=df_weo[\"Subject Descriptor\"].unique()[:-1]  ###########去掉最后一个空缺值\n",
    "df_weo_agg=df_weo[[\"Country\"]][df_weo[\"Country\"].duplicated()==False].reset_index(drop=True)\n",
    "for sub in subs[:]:\n",
    "    df_tmp=df_weo[[\"Country\",\"2019\"]][df_weo[\"Subject Descriptor\"]==sub].reset_index(drop=True)\n",
    "    df_tmp=df_tmp[df_tmp[\"Country\"].duplicated()==False].reset_index(drop=True)\n",
    "    df_tmp.columns=[\"Country\",sub]          ##############把表头的2019改了\n",
    "    df_weo_agg=df_weo_agg.merge(df_tmp,on=\"Country\",how=\"left\")\n",
    "df_weo_agg.columns=[\"\".join(c if c.isalnum() else \"_\" for c in str(x))for x in df_weo_agg.columns]\n",
    "df_weo_agg.columns\n",
    "df_weo_agg['Country/Region'] = df_weo_agg['Country']\n",
    "df_weo_agg.head()        #####################各个经济指标的数据"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 56,
   "metadata": {},
   "outputs": [],
   "source": [
    "####################合并新的数据"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 70,
   "metadata": {},
   "outputs": [
    {
     "name": "stdout",
     "output_type": "stream",
     "text": [
      "(30104, 60)\n"
     ]
    },
    {
     "data": {
      "text/html": [
       "<div>\n",
       "<style scoped>\n",
       "    .dataframe tbody tr th:only-of-type {\n",
       "        vertical-align: middle;\n",
       "    }\n",
       "\n",
       "    .dataframe tbody tr th {\n",
       "        vertical-align: top;\n",
       "    }\n",
       "\n",
       "    .dataframe thead th {\n",
       "        text-align: right;\n",
       "    }\n",
       "</style>\n",
       "<table border=\"1\" class=\"dataframe\">\n",
       "  <thead>\n",
       "    <tr style=\"text-align: right;\">\n",
       "      <th></th>\n",
       "      <th>Id</th>\n",
       "      <th>Province/State</th>\n",
       "      <th>Country/Region</th>\n",
       "      <th>Lat</th>\n",
       "      <th>Long</th>\n",
       "      <th>Date</th>\n",
       "      <th>ConfirmedCases</th>\n",
       "      <th>Fatalities</th>\n",
       "      <th>ForecastId</th>\n",
       "      <th>place_id</th>\n",
       "      <th>day</th>\n",
       "      <th>cases/day</th>\n",
       "      <th>fatal/day</th>\n",
       "      <th>cases/day-(1-1)</th>\n",
       "      <th>cases/day-(1-7)</th>\n",
       "      <th>cases/day-(8-14)</th>\n",
       "      <th>cases/day-(15-21)</th>\n",
       "      <th>fatal/day-(1-1)</th>\n",
       "      <th>fatal/day-(1-7)</th>\n",
       "      <th>fatal/day-(8-14)</th>\n",
       "      <th>fatal/day-(15-21)</th>\n",
       "      <th>days_since_1cases</th>\n",
       "      <th>days_since_10cases</th>\n",
       "      <th>days_since_100cases</th>\n",
       "      <th>days_since_1fatal</th>\n",
       "      <th>days_since_10fatal</th>\n",
       "      <th>days_since_100fatal</th>\n",
       "      <th>SmokingRate</th>\n",
       "      <th>Country</th>\n",
       "      <th>Gross_domestic_product__constant_prices</th>\n",
       "      <th>Gross_domestic_product__current_prices</th>\n",
       "      <th>Gross_domestic_product__deflator</th>\n",
       "      <th>Gross_domestic_product_per_capita__constant_prices</th>\n",
       "      <th>Gross_domestic_product_per_capita__current_prices</th>\n",
       "      <th>Output_gap_in_percent_of_potential_GDP</th>\n",
       "      <th>Gross_domestic_product_based_on_purchasing_power_parity__PPP__valuation_of_country_GDP</th>\n",
       "      <th>Gross_domestic_product_based_on_purchasing_power_parity__PPP__per_capita_GDP</th>\n",
       "      <th>Gross_domestic_product_based_on_purchasing_power_parity__PPP__share_of_world_total</th>\n",
       "      <th>Implied_PPP_conversion_rate</th>\n",
       "      <th>Total_investment</th>\n",
       "      <th>Gross_national_savings</th>\n",
       "      <th>Inflation__average_consumer_prices</th>\n",
       "      <th>Inflation__end_of_period_consumer_prices</th>\n",
       "      <th>Six_month_London_interbank_offered_rate__LIBOR_</th>\n",
       "      <th>Volume_of_imports_of_goods_and_services</th>\n",
       "      <th>Volume_of_Imports_of_goods</th>\n",
       "      <th>Volume_of_exports_of_goods_and_services</th>\n",
       "      <th>Volume_of_exports_of_goods</th>\n",
       "      <th>Unemployment_rate</th>\n",
       "      <th>Employment</th>\n",
       "      <th>Population</th>\n",
       "      <th>General_government_revenue</th>\n",
       "      <th>General_government_total_expenditure</th>\n",
       "      <th>General_government_net_lending_borrowing</th>\n",
       "      <th>General_government_structural_balance</th>\n",
       "      <th>General_government_primary_net_lending_borrowing</th>\n",
       "      <th>General_government_net_debt</th>\n",
       "      <th>General_government_gross_debt</th>\n",
       "      <th>Gross_domestic_product_corresponding_to_fiscal_year__current_prices</th>\n",
       "      <th>Current_account_balance</th>\n",
       "    </tr>\n",
       "  </thead>\n",
       "  <tbody>\n",
       "    <tr>\n",
       "      <th>0</th>\n",
       "      <td>1.0</td>\n",
       "      <td>NaN</td>\n",
       "      <td>Afghanistan</td>\n",
       "      <td>33.0</td>\n",
       "      <td>65.0</td>\n",
       "      <td>2020-01-22</td>\n",
       "      <td>0.0</td>\n",
       "      <td>0.0</td>\n",
       "      <td>NaN</td>\n",
       "      <td>Afghanistan</td>\n",
       "      <td>22</td>\n",
       "      <td>0</td>\n",
       "      <td>0</td>\n",
       "      <td>0.0</td>\n",
       "      <td>0.0</td>\n",
       "      <td>0.0</td>\n",
       "      <td>0.0</td>\n",
       "      <td>0.0</td>\n",
       "      <td>0.0</td>\n",
       "      <td>0.0</td>\n",
       "      <td>0.0</td>\n",
       "      <td>0</td>\n",
       "      <td>0</td>\n",
       "      <td>0</td>\n",
       "      <td>0</td>\n",
       "      <td>0</td>\n",
       "      <td>0</td>\n",
       "      <td>20.475517</td>\n",
       "      <td>Afghanistan</td>\n",
       "      <td>528.154</td>\n",
       "      <td>1,692.57</td>\n",
       "      <td>320.469</td>\n",
       "      <td>14,300.19</td>\n",
       "      <td>45,827.64</td>\n",
       "      <td>NaN</td>\n",
       "      <td>75.87</td>\n",
       "      <td>2,054.23</td>\n",
       "      <td>0.053</td>\n",
       "      <td>22.309</td>\n",
       "      <td>18.346</td>\n",
       "      <td>20.174</td>\n",
       "      <td>124.809</td>\n",
       "      <td>131.29</td>\n",
       "      <td>NaN</td>\n",
       "      <td>3.559</td>\n",
       "      <td>2.773</td>\n",
       "      <td>13.252</td>\n",
       "      <td>17.026</td>\n",
       "      <td>NaN</td>\n",
       "      <td>NaN</td>\n",
       "      <td>36.933</td>\n",
       "      <td>469.79</td>\n",
       "      <td>467.62</td>\n",
       "      <td>2.17</td>\n",
       "      <td>NaN</td>\n",
       "      <td>2.532</td>\n",
       "      <td>NaN</td>\n",
       "      <td>101.669</td>\n",
       "      <td>1,692.57</td>\n",
       "      <td>0.425</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>1</th>\n",
       "      <td>2.0</td>\n",
       "      <td>NaN</td>\n",
       "      <td>Afghanistan</td>\n",
       "      <td>33.0</td>\n",
       "      <td>65.0</td>\n",
       "      <td>2020-01-23</td>\n",
       "      <td>0.0</td>\n",
       "      <td>0.0</td>\n",
       "      <td>NaN</td>\n",
       "      <td>Afghanistan</td>\n",
       "      <td>23</td>\n",
       "      <td>0</td>\n",
       "      <td>0</td>\n",
       "      <td>0.0</td>\n",
       "      <td>0.0</td>\n",
       "      <td>0.0</td>\n",
       "      <td>0.0</td>\n",
       "      <td>0.0</td>\n",
       "      <td>0.0</td>\n",
       "      <td>0.0</td>\n",
       "      <td>0.0</td>\n",
       "      <td>0</td>\n",
       "      <td>0</td>\n",
       "      <td>0</td>\n",
       "      <td>0</td>\n",
       "      <td>0</td>\n",
       "      <td>0</td>\n",
       "      <td>20.475517</td>\n",
       "      <td>Afghanistan</td>\n",
       "      <td>528.154</td>\n",
       "      <td>1,692.57</td>\n",
       "      <td>320.469</td>\n",
       "      <td>14,300.19</td>\n",
       "      <td>45,827.64</td>\n",
       "      <td>NaN</td>\n",
       "      <td>75.87</td>\n",
       "      <td>2,054.23</td>\n",
       "      <td>0.053</td>\n",
       "      <td>22.309</td>\n",
       "      <td>18.346</td>\n",
       "      <td>20.174</td>\n",
       "      <td>124.809</td>\n",
       "      <td>131.29</td>\n",
       "      <td>NaN</td>\n",
       "      <td>3.559</td>\n",
       "      <td>2.773</td>\n",
       "      <td>13.252</td>\n",
       "      <td>17.026</td>\n",
       "      <td>NaN</td>\n",
       "      <td>NaN</td>\n",
       "      <td>36.933</td>\n",
       "      <td>469.79</td>\n",
       "      <td>467.62</td>\n",
       "      <td>2.17</td>\n",
       "      <td>NaN</td>\n",
       "      <td>2.532</td>\n",
       "      <td>NaN</td>\n",
       "      <td>101.669</td>\n",
       "      <td>1,692.57</td>\n",
       "      <td>0.425</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>2</th>\n",
       "      <td>3.0</td>\n",
       "      <td>NaN</td>\n",
       "      <td>Afghanistan</td>\n",
       "      <td>33.0</td>\n",
       "      <td>65.0</td>\n",
       "      <td>2020-01-24</td>\n",
       "      <td>0.0</td>\n",
       "      <td>0.0</td>\n",
       "      <td>NaN</td>\n",
       "      <td>Afghanistan</td>\n",
       "      <td>24</td>\n",
       "      <td>0</td>\n",
       "      <td>0</td>\n",
       "      <td>0.0</td>\n",
       "      <td>0.0</td>\n",
       "      <td>0.0</td>\n",
       "      <td>0.0</td>\n",
       "      <td>0.0</td>\n",
       "      <td>0.0</td>\n",
       "      <td>0.0</td>\n",
       "      <td>0.0</td>\n",
       "      <td>0</td>\n",
       "      <td>0</td>\n",
       "      <td>0</td>\n",
       "      <td>0</td>\n",
       "      <td>0</td>\n",
       "      <td>0</td>\n",
       "      <td>20.475517</td>\n",
       "      <td>Afghanistan</td>\n",
       "      <td>528.154</td>\n",
       "      <td>1,692.57</td>\n",
       "      <td>320.469</td>\n",
       "      <td>14,300.19</td>\n",
       "      <td>45,827.64</td>\n",
       "      <td>NaN</td>\n",
       "      <td>75.87</td>\n",
       "      <td>2,054.23</td>\n",
       "      <td>0.053</td>\n",
       "      <td>22.309</td>\n",
       "      <td>18.346</td>\n",
       "      <td>20.174</td>\n",
       "      <td>124.809</td>\n",
       "      <td>131.29</td>\n",
       "      <td>NaN</td>\n",
       "      <td>3.559</td>\n",
       "      <td>2.773</td>\n",
       "      <td>13.252</td>\n",
       "      <td>17.026</td>\n",
       "      <td>NaN</td>\n",
       "      <td>NaN</td>\n",
       "      <td>36.933</td>\n",
       "      <td>469.79</td>\n",
       "      <td>467.62</td>\n",
       "      <td>2.17</td>\n",
       "      <td>NaN</td>\n",
       "      <td>2.532</td>\n",
       "      <td>NaN</td>\n",
       "      <td>101.669</td>\n",
       "      <td>1,692.57</td>\n",
       "      <td>0.425</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>3</th>\n",
       "      <td>4.0</td>\n",
       "      <td>NaN</td>\n",
       "      <td>Afghanistan</td>\n",
       "      <td>33.0</td>\n",
       "      <td>65.0</td>\n",
       "      <td>2020-01-25</td>\n",
       "      <td>0.0</td>\n",
       "      <td>0.0</td>\n",
       "      <td>NaN</td>\n",
       "      <td>Afghanistan</td>\n",
       "      <td>25</td>\n",
       "      <td>0</td>\n",
       "      <td>0</td>\n",
       "      <td>0.0</td>\n",
       "      <td>0.0</td>\n",
       "      <td>0.0</td>\n",
       "      <td>0.0</td>\n",
       "      <td>0.0</td>\n",
       "      <td>0.0</td>\n",
       "      <td>0.0</td>\n",
       "      <td>0.0</td>\n",
       "      <td>0</td>\n",
       "      <td>0</td>\n",
       "      <td>0</td>\n",
       "      <td>0</td>\n",
       "      <td>0</td>\n",
       "      <td>0</td>\n",
       "      <td>20.475517</td>\n",
       "      <td>Afghanistan</td>\n",
       "      <td>528.154</td>\n",
       "      <td>1,692.57</td>\n",
       "      <td>320.469</td>\n",
       "      <td>14,300.19</td>\n",
       "      <td>45,827.64</td>\n",
       "      <td>NaN</td>\n",
       "      <td>75.87</td>\n",
       "      <td>2,054.23</td>\n",
       "      <td>0.053</td>\n",
       "      <td>22.309</td>\n",
       "      <td>18.346</td>\n",
       "      <td>20.174</td>\n",
       "      <td>124.809</td>\n",
       "      <td>131.29</td>\n",
       "      <td>NaN</td>\n",
       "      <td>3.559</td>\n",
       "      <td>2.773</td>\n",
       "      <td>13.252</td>\n",
       "      <td>17.026</td>\n",
       "      <td>NaN</td>\n",
       "      <td>NaN</td>\n",
       "      <td>36.933</td>\n",
       "      <td>469.79</td>\n",
       "      <td>467.62</td>\n",
       "      <td>2.17</td>\n",
       "      <td>NaN</td>\n",
       "      <td>2.532</td>\n",
       "      <td>NaN</td>\n",
       "      <td>101.669</td>\n",
       "      <td>1,692.57</td>\n",
       "      <td>0.425</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>4</th>\n",
       "      <td>5.0</td>\n",
       "      <td>NaN</td>\n",
       "      <td>Afghanistan</td>\n",
       "      <td>33.0</td>\n",
       "      <td>65.0</td>\n",
       "      <td>2020-01-26</td>\n",
       "      <td>0.0</td>\n",
       "      <td>0.0</td>\n",
       "      <td>NaN</td>\n",
       "      <td>Afghanistan</td>\n",
       "      <td>26</td>\n",
       "      <td>0</td>\n",
       "      <td>0</td>\n",
       "      <td>0.0</td>\n",
       "      <td>0.0</td>\n",
       "      <td>0.0</td>\n",
       "      <td>0.0</td>\n",
       "      <td>0.0</td>\n",
       "      <td>0.0</td>\n",
       "      <td>0.0</td>\n",
       "      <td>0.0</td>\n",
       "      <td>0</td>\n",
       "      <td>0</td>\n",
       "      <td>0</td>\n",
       "      <td>0</td>\n",
       "      <td>0</td>\n",
       "      <td>0</td>\n",
       "      <td>20.475517</td>\n",
       "      <td>Afghanistan</td>\n",
       "      <td>528.154</td>\n",
       "      <td>1,692.57</td>\n",
       "      <td>320.469</td>\n",
       "      <td>14,300.19</td>\n",
       "      <td>45,827.64</td>\n",
       "      <td>NaN</td>\n",
       "      <td>75.87</td>\n",
       "      <td>2,054.23</td>\n",
       "      <td>0.053</td>\n",
       "      <td>22.309</td>\n",
       "      <td>18.346</td>\n",
       "      <td>20.174</td>\n",
       "      <td>124.809</td>\n",
       "      <td>131.29</td>\n",
       "      <td>NaN</td>\n",
       "      <td>3.559</td>\n",
       "      <td>2.773</td>\n",
       "      <td>13.252</td>\n",
       "      <td>17.026</td>\n",
       "      <td>NaN</td>\n",
       "      <td>NaN</td>\n",
       "      <td>36.933</td>\n",
       "      <td>469.79</td>\n",
       "      <td>467.62</td>\n",
       "      <td>2.17</td>\n",
       "      <td>NaN</td>\n",
       "      <td>2.532</td>\n",
       "      <td>NaN</td>\n",
       "      <td>101.669</td>\n",
       "      <td>1,692.57</td>\n",
       "      <td>0.425</td>\n",
       "    </tr>\n",
       "  </tbody>\n",
       "</table>\n",
       "</div>"
      ],
      "text/plain": [
       "    Id Province/State Country/Region   Lat  Long       Date  ConfirmedCases  \\\n",
       "0  1.0            NaN    Afghanistan  33.0  65.0 2020-01-22             0.0   \n",
       "1  2.0            NaN    Afghanistan  33.0  65.0 2020-01-23             0.0   \n",
       "2  3.0            NaN    Afghanistan  33.0  65.0 2020-01-24             0.0   \n",
       "3  4.0            NaN    Afghanistan  33.0  65.0 2020-01-25             0.0   \n",
       "4  5.0            NaN    Afghanistan  33.0  65.0 2020-01-26             0.0   \n",
       "\n",
       "   Fatalities  ForecastId     place_id  day  cases/day  fatal/day  \\\n",
       "0         0.0         NaN  Afghanistan   22          0          0   \n",
       "1         0.0         NaN  Afghanistan   23          0          0   \n",
       "2         0.0         NaN  Afghanistan   24          0          0   \n",
       "3         0.0         NaN  Afghanistan   25          0          0   \n",
       "4         0.0         NaN  Afghanistan   26          0          0   \n",
       "\n",
       "   cases/day-(1-1)  cases/day-(1-7)  cases/day-(8-14)  cases/day-(15-21)  \\\n",
       "0              0.0              0.0               0.0                0.0   \n",
       "1              0.0              0.0               0.0                0.0   \n",
       "2              0.0              0.0               0.0                0.0   \n",
       "3              0.0              0.0               0.0                0.0   \n",
       "4              0.0              0.0               0.0                0.0   \n",
       "\n",
       "   fatal/day-(1-1)  fatal/day-(1-7)  fatal/day-(8-14)  fatal/day-(15-21)  \\\n",
       "0              0.0              0.0               0.0                0.0   \n",
       "1              0.0              0.0               0.0                0.0   \n",
       "2              0.0              0.0               0.0                0.0   \n",
       "3              0.0              0.0               0.0                0.0   \n",
       "4              0.0              0.0               0.0                0.0   \n",
       "\n",
       "   days_since_1cases  days_since_10cases  days_since_100cases  \\\n",
       "0                  0                   0                    0   \n",
       "1                  0                   0                    0   \n",
       "2                  0                   0                    0   \n",
       "3                  0                   0                    0   \n",
       "4                  0                   0                    0   \n",
       "\n",
       "   days_since_1fatal  days_since_10fatal  days_since_100fatal  SmokingRate  \\\n",
       "0                  0                   0                    0    20.475517   \n",
       "1                  0                   0                    0    20.475517   \n",
       "2                  0                   0                    0    20.475517   \n",
       "3                  0                   0                    0    20.475517   \n",
       "4                  0                   0                    0    20.475517   \n",
       "\n",
       "       Country Gross_domestic_product__constant_prices  \\\n",
       "0  Afghanistan                                 528.154   \n",
       "1  Afghanistan                                 528.154   \n",
       "2  Afghanistan                                 528.154   \n",
       "3  Afghanistan                                 528.154   \n",
       "4  Afghanistan                                 528.154   \n",
       "\n",
       "  Gross_domestic_product__current_prices Gross_domestic_product__deflator  \\\n",
       "0                               1,692.57                          320.469   \n",
       "1                               1,692.57                          320.469   \n",
       "2                               1,692.57                          320.469   \n",
       "3                               1,692.57                          320.469   \n",
       "4                               1,692.57                          320.469   \n",
       "\n",
       "  Gross_domestic_product_per_capita__constant_prices  \\\n",
       "0                                          14,300.19   \n",
       "1                                          14,300.19   \n",
       "2                                          14,300.19   \n",
       "3                                          14,300.19   \n",
       "4                                          14,300.19   \n",
       "\n",
       "  Gross_domestic_product_per_capita__current_prices  \\\n",
       "0                                         45,827.64   \n",
       "1                                         45,827.64   \n",
       "2                                         45,827.64   \n",
       "3                                         45,827.64   \n",
       "4                                         45,827.64   \n",
       "\n",
       "  Output_gap_in_percent_of_potential_GDP  \\\n",
       "0                                    NaN   \n",
       "1                                    NaN   \n",
       "2                                    NaN   \n",
       "3                                    NaN   \n",
       "4                                    NaN   \n",
       "\n",
       "  Gross_domestic_product_based_on_purchasing_power_parity__PPP__valuation_of_country_GDP  \\\n",
       "0                                              75.87                                       \n",
       "1                                              75.87                                       \n",
       "2                                              75.87                                       \n",
       "3                                              75.87                                       \n",
       "4                                              75.87                                       \n",
       "\n",
       "  Gross_domestic_product_based_on_purchasing_power_parity__PPP__per_capita_GDP  \\\n",
       "0                                           2,054.23                             \n",
       "1                                           2,054.23                             \n",
       "2                                           2,054.23                             \n",
       "3                                           2,054.23                             \n",
       "4                                           2,054.23                             \n",
       "\n",
       "  Gross_domestic_product_based_on_purchasing_power_parity__PPP__share_of_world_total  \\\n",
       "0                                              0.053                                   \n",
       "1                                              0.053                                   \n",
       "2                                              0.053                                   \n",
       "3                                              0.053                                   \n",
       "4                                              0.053                                   \n",
       "\n",
       "  Implied_PPP_conversion_rate Total_investment Gross_national_savings  \\\n",
       "0                      22.309           18.346                 20.174   \n",
       "1                      22.309           18.346                 20.174   \n",
       "2                      22.309           18.346                 20.174   \n",
       "3                      22.309           18.346                 20.174   \n",
       "4                      22.309           18.346                 20.174   \n",
       "\n",
       "  Inflation__average_consumer_prices Inflation__end_of_period_consumer_prices  \\\n",
       "0                            124.809                                   131.29   \n",
       "1                            124.809                                   131.29   \n",
       "2                            124.809                                   131.29   \n",
       "3                            124.809                                   131.29   \n",
       "4                            124.809                                   131.29   \n",
       "\n",
       "  Six_month_London_interbank_offered_rate__LIBOR_  \\\n",
       "0                                             NaN   \n",
       "1                                             NaN   \n",
       "2                                             NaN   \n",
       "3                                             NaN   \n",
       "4                                             NaN   \n",
       "\n",
       "  Volume_of_imports_of_goods_and_services Volume_of_Imports_of_goods  \\\n",
       "0                                   3.559                      2.773   \n",
       "1                                   3.559                      2.773   \n",
       "2                                   3.559                      2.773   \n",
       "3                                   3.559                      2.773   \n",
       "4                                   3.559                      2.773   \n",
       "\n",
       "  Volume_of_exports_of_goods_and_services Volume_of_exports_of_goods  \\\n",
       "0                                  13.252                     17.026   \n",
       "1                                  13.252                     17.026   \n",
       "2                                  13.252                     17.026   \n",
       "3                                  13.252                     17.026   \n",
       "4                                  13.252                     17.026   \n",
       "\n",
       "  Unemployment_rate Employment Population General_government_revenue  \\\n",
       "0               NaN        NaN     36.933                     469.79   \n",
       "1               NaN        NaN     36.933                     469.79   \n",
       "2               NaN        NaN     36.933                     469.79   \n",
       "3               NaN        NaN     36.933                     469.79   \n",
       "4               NaN        NaN     36.933                     469.79   \n",
       "\n",
       "  General_government_total_expenditure  \\\n",
       "0                               467.62   \n",
       "1                               467.62   \n",
       "2                               467.62   \n",
       "3                               467.62   \n",
       "4                               467.62   \n",
       "\n",
       "  General_government_net_lending_borrowing  \\\n",
       "0                                     2.17   \n",
       "1                                     2.17   \n",
       "2                                     2.17   \n",
       "3                                     2.17   \n",
       "4                                     2.17   \n",
       "\n",
       "  General_government_structural_balance  \\\n",
       "0                                   NaN   \n",
       "1                                   NaN   \n",
       "2                                   NaN   \n",
       "3                                   NaN   \n",
       "4                                   NaN   \n",
       "\n",
       "  General_government_primary_net_lending_borrowing  \\\n",
       "0                                            2.532   \n",
       "1                                            2.532   \n",
       "2                                            2.532   \n",
       "3                                            2.532   \n",
       "4                                            2.532   \n",
       "\n",
       "  General_government_net_debt General_government_gross_debt  \\\n",
       "0                         NaN                       101.669   \n",
       "1                         NaN                       101.669   \n",
       "2                         NaN                       101.669   \n",
       "3                         NaN                       101.669   \n",
       "4                         NaN                       101.669   \n",
       "\n",
       "  Gross_domestic_product_corresponding_to_fiscal_year__current_prices  \\\n",
       "0                                           1,692.57                    \n",
       "1                                           1,692.57                    \n",
       "2                                           1,692.57                    \n",
       "3                                           1,692.57                    \n",
       "4                                           1,692.57                    \n",
       "\n",
       "  Current_account_balance  \n",
       "0                   0.425  \n",
       "1                   0.425  \n",
       "2                   0.425  \n",
       "3                   0.425  \n",
       "4                   0.425  "
      ]
     },
     "execution_count": 70,
     "metadata": {},
     "output_type": "execute_result"
    }
   ],
   "source": [
    "df_traintest5 = pd.merge(df_traintest4, df_weo_agg, on='Country/Region', how='left')\n",
    "print(df_traintest5.shape)\n",
    "df_traintest5.head()      #####################有空缺值很正常，很粗的数据"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 58,
   "metadata": {},
   "outputs": [],
   "source": [
    "#####################引入人均寿命的数据：\n",
    "####################人均寿命可以笼统地代表地区卫生水平高低以及该地区居民身体素质"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 71,
   "metadata": {},
   "outputs": [],
   "source": [
    "df_life = pd.read_csv(\"F:\\kaggle\\covid-first\\Life expectancy at birth.csv\")"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 72,
   "metadata": {},
   "outputs": [
    {
     "data": {
      "text/html": [
       "<div>\n",
       "<style scoped>\n",
       "    .dataframe tbody tr th:only-of-type {\n",
       "        vertical-align: middle;\n",
       "    }\n",
       "\n",
       "    .dataframe tbody tr th {\n",
       "        vertical-align: top;\n",
       "    }\n",
       "\n",
       "    .dataframe thead th {\n",
       "        text-align: right;\n",
       "    }\n",
       "</style>\n",
       "<table border=\"1\" class=\"dataframe\">\n",
       "  <thead>\n",
       "    <tr style=\"text-align: right;\">\n",
       "      <th></th>\n",
       "      <th>HDI Rank (2018)</th>\n",
       "      <th>Country</th>\n",
       "      <th>1990</th>\n",
       "      <th>Unnamed: 3</th>\n",
       "      <th>1991</th>\n",
       "      <th>Unnamed: 5</th>\n",
       "      <th>1992</th>\n",
       "      <th>Unnamed: 7</th>\n",
       "      <th>1993</th>\n",
       "      <th>Unnamed: 9</th>\n",
       "      <th>1994</th>\n",
       "      <th>Unnamed: 11</th>\n",
       "      <th>1995</th>\n",
       "      <th>Unnamed: 13</th>\n",
       "      <th>1996</th>\n",
       "      <th>Unnamed: 15</th>\n",
       "      <th>1997</th>\n",
       "      <th>Unnamed: 17</th>\n",
       "      <th>1998</th>\n",
       "      <th>Unnamed: 19</th>\n",
       "      <th>1999</th>\n",
       "      <th>Unnamed: 21</th>\n",
       "      <th>2000</th>\n",
       "      <th>Unnamed: 23</th>\n",
       "      <th>2001</th>\n",
       "      <th>Unnamed: 25</th>\n",
       "      <th>2002</th>\n",
       "      <th>Unnamed: 27</th>\n",
       "      <th>2003</th>\n",
       "      <th>Unnamed: 29</th>\n",
       "      <th>2004</th>\n",
       "      <th>Unnamed: 31</th>\n",
       "      <th>2005</th>\n",
       "      <th>Unnamed: 33</th>\n",
       "      <th>2006</th>\n",
       "      <th>Unnamed: 35</th>\n",
       "      <th>2007</th>\n",
       "      <th>Unnamed: 37</th>\n",
       "      <th>2008</th>\n",
       "      <th>Unnamed: 39</th>\n",
       "      <th>2009</th>\n",
       "      <th>Unnamed: 41</th>\n",
       "      <th>2010</th>\n",
       "      <th>Unnamed: 43</th>\n",
       "      <th>2011</th>\n",
       "      <th>Unnamed: 45</th>\n",
       "      <th>2012</th>\n",
       "      <th>Unnamed: 47</th>\n",
       "      <th>2013</th>\n",
       "      <th>Unnamed: 49</th>\n",
       "      <th>2014</th>\n",
       "      <th>Unnamed: 51</th>\n",
       "      <th>2015</th>\n",
       "      <th>Unnamed: 53</th>\n",
       "      <th>2016</th>\n",
       "      <th>Unnamed: 55</th>\n",
       "      <th>2017</th>\n",
       "      <th>Unnamed: 57</th>\n",
       "      <th>2018</th>\n",
       "      <th>Unnamed: 59</th>\n",
       "    </tr>\n",
       "  </thead>\n",
       "  <tbody>\n",
       "    <tr>\n",
       "      <th>0</th>\n",
       "      <td>170</td>\n",
       "      <td>Afghanistan</td>\n",
       "      <td>50.3</td>\n",
       "      <td>NaN</td>\n",
       "      <td>51</td>\n",
       "      <td>NaN</td>\n",
       "      <td>51.6</td>\n",
       "      <td>NaN</td>\n",
       "      <td>52.3</td>\n",
       "      <td>NaN</td>\n",
       "      <td>52.8</td>\n",
       "      <td>NaN</td>\n",
       "      <td>53.4</td>\n",
       "      <td>NaN</td>\n",
       "      <td>53.9</td>\n",
       "      <td>NaN</td>\n",
       "      <td>54.4</td>\n",
       "      <td>NaN</td>\n",
       "      <td>54.9</td>\n",
       "      <td>NaN</td>\n",
       "      <td>55.4</td>\n",
       "      <td>NaN</td>\n",
       "      <td>55.8</td>\n",
       "      <td>NaN</td>\n",
       "      <td>56.3</td>\n",
       "      <td>NaN</td>\n",
       "      <td>56.8</td>\n",
       "      <td>NaN</td>\n",
       "      <td>57.3</td>\n",
       "      <td>NaN</td>\n",
       "      <td>57.8</td>\n",
       "      <td>NaN</td>\n",
       "      <td>58.3</td>\n",
       "      <td>NaN</td>\n",
       "      <td>58.8</td>\n",
       "      <td>NaN</td>\n",
       "      <td>59.4</td>\n",
       "      <td>NaN</td>\n",
       "      <td>59.9</td>\n",
       "      <td>NaN</td>\n",
       "      <td>60.5</td>\n",
       "      <td>NaN</td>\n",
       "      <td>61</td>\n",
       "      <td>NaN</td>\n",
       "      <td>61.6</td>\n",
       "      <td>NaN</td>\n",
       "      <td>62.1</td>\n",
       "      <td>NaN</td>\n",
       "      <td>62.5</td>\n",
       "      <td>NaN</td>\n",
       "      <td>63</td>\n",
       "      <td>NaN</td>\n",
       "      <td>63.4</td>\n",
       "      <td>NaN</td>\n",
       "      <td>63.8</td>\n",
       "      <td>NaN</td>\n",
       "      <td>64.1</td>\n",
       "      <td>NaN</td>\n",
       "      <td>64.5</td>\n",
       "      <td>NaN</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>1</th>\n",
       "      <td>69</td>\n",
       "      <td>Albania</td>\n",
       "      <td>71.8</td>\n",
       "      <td>NaN</td>\n",
       "      <td>71.8</td>\n",
       "      <td>NaN</td>\n",
       "      <td>71.8</td>\n",
       "      <td>NaN</td>\n",
       "      <td>71.9</td>\n",
       "      <td>NaN</td>\n",
       "      <td>72</td>\n",
       "      <td>NaN</td>\n",
       "      <td>72.2</td>\n",
       "      <td>NaN</td>\n",
       "      <td>72.5</td>\n",
       "      <td>NaN</td>\n",
       "      <td>72.8</td>\n",
       "      <td>NaN</td>\n",
       "      <td>73.2</td>\n",
       "      <td>NaN</td>\n",
       "      <td>73.6</td>\n",
       "      <td>NaN</td>\n",
       "      <td>74</td>\n",
       "      <td>NaN</td>\n",
       "      <td>74.3</td>\n",
       "      <td>NaN</td>\n",
       "      <td>74.6</td>\n",
       "      <td>NaN</td>\n",
       "      <td>74.8</td>\n",
       "      <td>NaN</td>\n",
       "      <td>75</td>\n",
       "      <td>NaN</td>\n",
       "      <td>75.2</td>\n",
       "      <td>NaN</td>\n",
       "      <td>75.4</td>\n",
       "      <td>NaN</td>\n",
       "      <td>75.6</td>\n",
       "      <td>NaN</td>\n",
       "      <td>75.9</td>\n",
       "      <td>NaN</td>\n",
       "      <td>76.2</td>\n",
       "      <td>NaN</td>\n",
       "      <td>76.6</td>\n",
       "      <td>NaN</td>\n",
       "      <td>76.9</td>\n",
       "      <td>NaN</td>\n",
       "      <td>77.3</td>\n",
       "      <td>NaN</td>\n",
       "      <td>77.6</td>\n",
       "      <td>NaN</td>\n",
       "      <td>77.8</td>\n",
       "      <td>NaN</td>\n",
       "      <td>78</td>\n",
       "      <td>NaN</td>\n",
       "      <td>78.2</td>\n",
       "      <td>NaN</td>\n",
       "      <td>78.3</td>\n",
       "      <td>NaN</td>\n",
       "      <td>78.5</td>\n",
       "      <td>NaN</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>2</th>\n",
       "      <td>82</td>\n",
       "      <td>Algeria</td>\n",
       "      <td>66.9</td>\n",
       "      <td>NaN</td>\n",
       "      <td>67.3</td>\n",
       "      <td>NaN</td>\n",
       "      <td>67.6</td>\n",
       "      <td>NaN</td>\n",
       "      <td>67.9</td>\n",
       "      <td>NaN</td>\n",
       "      <td>68.2</td>\n",
       "      <td>NaN</td>\n",
       "      <td>68.5</td>\n",
       "      <td>NaN</td>\n",
       "      <td>68.9</td>\n",
       "      <td>NaN</td>\n",
       "      <td>69.3</td>\n",
       "      <td>NaN</td>\n",
       "      <td>69.7</td>\n",
       "      <td>NaN</td>\n",
       "      <td>70.2</td>\n",
       "      <td>NaN</td>\n",
       "      <td>70.6</td>\n",
       "      <td>NaN</td>\n",
       "      <td>71.1</td>\n",
       "      <td>NaN</td>\n",
       "      <td>71.6</td>\n",
       "      <td>NaN</td>\n",
       "      <td>72.1</td>\n",
       "      <td>NaN</td>\n",
       "      <td>72.6</td>\n",
       "      <td>NaN</td>\n",
       "      <td>73.1</td>\n",
       "      <td>NaN</td>\n",
       "      <td>73.5</td>\n",
       "      <td>NaN</td>\n",
       "      <td>73.9</td>\n",
       "      <td>NaN</td>\n",
       "      <td>74.3</td>\n",
       "      <td>NaN</td>\n",
       "      <td>74.6</td>\n",
       "      <td>NaN</td>\n",
       "      <td>74.9</td>\n",
       "      <td>NaN</td>\n",
       "      <td>75.2</td>\n",
       "      <td>NaN</td>\n",
       "      <td>75.4</td>\n",
       "      <td>NaN</td>\n",
       "      <td>75.7</td>\n",
       "      <td>NaN</td>\n",
       "      <td>75.9</td>\n",
       "      <td>NaN</td>\n",
       "      <td>76.1</td>\n",
       "      <td>NaN</td>\n",
       "      <td>76.3</td>\n",
       "      <td>NaN</td>\n",
       "      <td>76.5</td>\n",
       "      <td>NaN</td>\n",
       "      <td>76.7</td>\n",
       "      <td>NaN</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>3</th>\n",
       "      <td>36</td>\n",
       "      <td>Andorra</td>\n",
       "      <td>76.5</td>\n",
       "      <td>NaN</td>\n",
       "      <td>76.7</td>\n",
       "      <td>NaN</td>\n",
       "      <td>76.9</td>\n",
       "      <td>NaN</td>\n",
       "      <td>77</td>\n",
       "      <td>NaN</td>\n",
       "      <td>77.2</td>\n",
       "      <td>NaN</td>\n",
       "      <td>77.4</td>\n",
       "      <td>NaN</td>\n",
       "      <td>77.6</td>\n",
       "      <td>NaN</td>\n",
       "      <td>77.9</td>\n",
       "      <td>NaN</td>\n",
       "      <td>78.2</td>\n",
       "      <td>NaN</td>\n",
       "      <td>78.5</td>\n",
       "      <td>NaN</td>\n",
       "      <td>78.9</td>\n",
       "      <td>NaN</td>\n",
       "      <td>79.2</td>\n",
       "      <td>NaN</td>\n",
       "      <td>79.5</td>\n",
       "      <td>NaN</td>\n",
       "      <td>79.8</td>\n",
       "      <td>NaN</td>\n",
       "      <td>80</td>\n",
       "      <td>NaN</td>\n",
       "      <td>80.2</td>\n",
       "      <td>NaN</td>\n",
       "      <td>80.3</td>\n",
       "      <td>NaN</td>\n",
       "      <td>80.5</td>\n",
       "      <td>NaN</td>\n",
       "      <td>80.6</td>\n",
       "      <td>NaN</td>\n",
       "      <td>80.7</td>\n",
       "      <td>NaN</td>\n",
       "      <td>80.8</td>\n",
       "      <td>NaN</td>\n",
       "      <td>80.9</td>\n",
       "      <td>NaN</td>\n",
       "      <td>81.1</td>\n",
       "      <td>NaN</td>\n",
       "      <td>81.2</td>\n",
       "      <td>NaN</td>\n",
       "      <td>81.3</td>\n",
       "      <td>NaN</td>\n",
       "      <td>81.4</td>\n",
       "      <td>NaN</td>\n",
       "      <td>81.5</td>\n",
       "      <td>NaN</td>\n",
       "      <td>81.7</td>\n",
       "      <td>NaN</td>\n",
       "      <td>81.8</td>\n",
       "      <td>a</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>4</th>\n",
       "      <td>149</td>\n",
       "      <td>Angola</td>\n",
       "      <td>45.3</td>\n",
       "      <td>NaN</td>\n",
       "      <td>45.3</td>\n",
       "      <td>NaN</td>\n",
       "      <td>45.2</td>\n",
       "      <td>NaN</td>\n",
       "      <td>45.2</td>\n",
       "      <td>NaN</td>\n",
       "      <td>45.2</td>\n",
       "      <td>NaN</td>\n",
       "      <td>45.2</td>\n",
       "      <td>NaN</td>\n",
       "      <td>45.4</td>\n",
       "      <td>NaN</td>\n",
       "      <td>45.5</td>\n",
       "      <td>NaN</td>\n",
       "      <td>45.8</td>\n",
       "      <td>NaN</td>\n",
       "      <td>46.1</td>\n",
       "      <td>NaN</td>\n",
       "      <td>46.5</td>\n",
       "      <td>NaN</td>\n",
       "      <td>47.1</td>\n",
       "      <td>NaN</td>\n",
       "      <td>47.7</td>\n",
       "      <td>NaN</td>\n",
       "      <td>48.4</td>\n",
       "      <td>NaN</td>\n",
       "      <td>49.3</td>\n",
       "      <td>NaN</td>\n",
       "      <td>50.2</td>\n",
       "      <td>NaN</td>\n",
       "      <td>51.1</td>\n",
       "      <td>NaN</td>\n",
       "      <td>52.2</td>\n",
       "      <td>NaN</td>\n",
       "      <td>53.2</td>\n",
       "      <td>NaN</td>\n",
       "      <td>54.3</td>\n",
       "      <td>NaN</td>\n",
       "      <td>55.4</td>\n",
       "      <td>NaN</td>\n",
       "      <td>56.3</td>\n",
       "      <td>NaN</td>\n",
       "      <td>57.2</td>\n",
       "      <td>NaN</td>\n",
       "      <td>58.1</td>\n",
       "      <td>NaN</td>\n",
       "      <td>58.8</td>\n",
       "      <td>NaN</td>\n",
       "      <td>59.4</td>\n",
       "      <td>NaN</td>\n",
       "      <td>59.9</td>\n",
       "      <td>NaN</td>\n",
       "      <td>60.4</td>\n",
       "      <td>NaN</td>\n",
       "      <td>60.8</td>\n",
       "      <td>NaN</td>\n",
       "    </tr>\n",
       "  </tbody>\n",
       "</table>\n",
       "</div>"
      ],
      "text/plain": [
       "  HDI Rank (2018)      Country  1990  Unnamed: 3  1991  Unnamed: 5  1992  \\\n",
       "0             170  Afghanistan  50.3         NaN    51         NaN  51.6   \n",
       "1              69      Albania  71.8         NaN  71.8         NaN  71.8   \n",
       "2              82      Algeria  66.9         NaN  67.3         NaN  67.6   \n",
       "3              36      Andorra  76.5         NaN  76.7         NaN  76.9   \n",
       "4             149       Angola  45.3         NaN  45.3         NaN  45.2   \n",
       "\n",
       "   Unnamed: 7  1993  Unnamed: 9  1994  Unnamed: 11  1995  Unnamed: 13  1996  \\\n",
       "0         NaN  52.3         NaN  52.8          NaN  53.4          NaN  53.9   \n",
       "1         NaN  71.9         NaN    72          NaN  72.2          NaN  72.5   \n",
       "2         NaN  67.9         NaN  68.2          NaN  68.5          NaN  68.9   \n",
       "3         NaN    77         NaN  77.2          NaN  77.4          NaN  77.6   \n",
       "4         NaN  45.2         NaN  45.2          NaN  45.2          NaN  45.4   \n",
       "\n",
       "   Unnamed: 15  1997  Unnamed: 17  1998  Unnamed: 19  1999  Unnamed: 21  2000  \\\n",
       "0          NaN  54.4          NaN  54.9          NaN  55.4          NaN  55.8   \n",
       "1          NaN  72.8          NaN  73.2          NaN  73.6          NaN    74   \n",
       "2          NaN  69.3          NaN  69.7          NaN  70.2          NaN  70.6   \n",
       "3          NaN  77.9          NaN  78.2          NaN  78.5          NaN  78.9   \n",
       "4          NaN  45.5          NaN  45.8          NaN  46.1          NaN  46.5   \n",
       "\n",
       "   Unnamed: 23  2001  Unnamed: 25  2002  Unnamed: 27  2003  Unnamed: 29  2004  \\\n",
       "0          NaN  56.3          NaN  56.8          NaN  57.3          NaN  57.8   \n",
       "1          NaN  74.3          NaN  74.6          NaN  74.8          NaN    75   \n",
       "2          NaN  71.1          NaN  71.6          NaN  72.1          NaN  72.6   \n",
       "3          NaN  79.2          NaN  79.5          NaN  79.8          NaN    80   \n",
       "4          NaN  47.1          NaN  47.7          NaN  48.4          NaN  49.3   \n",
       "\n",
       "   Unnamed: 31  2005  Unnamed: 33  2006  Unnamed: 35  2007  Unnamed: 37  2008  \\\n",
       "0          NaN  58.3          NaN  58.8          NaN  59.4          NaN  59.9   \n",
       "1          NaN  75.2          NaN  75.4          NaN  75.6          NaN  75.9   \n",
       "2          NaN  73.1          NaN  73.5          NaN  73.9          NaN  74.3   \n",
       "3          NaN  80.2          NaN  80.3          NaN  80.5          NaN  80.6   \n",
       "4          NaN  50.2          NaN  51.1          NaN  52.2          NaN  53.2   \n",
       "\n",
       "   Unnamed: 39  2009  Unnamed: 41  2010  Unnamed: 43  2011  Unnamed: 45  2012  \\\n",
       "0          NaN  60.5          NaN    61          NaN  61.6          NaN  62.1   \n",
       "1          NaN  76.2          NaN  76.6          NaN  76.9          NaN  77.3   \n",
       "2          NaN  74.6          NaN  74.9          NaN  75.2          NaN  75.4   \n",
       "3          NaN  80.7          NaN  80.8          NaN  80.9          NaN  81.1   \n",
       "4          NaN  54.3          NaN  55.4          NaN  56.3          NaN  57.2   \n",
       "\n",
       "   Unnamed: 47  2013  Unnamed: 49  2014  Unnamed: 51  2015  Unnamed: 53  2016  \\\n",
       "0          NaN  62.5          NaN    63          NaN  63.4          NaN  63.8   \n",
       "1          NaN  77.6          NaN  77.8          NaN    78          NaN  78.2   \n",
       "2          NaN  75.7          NaN  75.9          NaN  76.1          NaN  76.3   \n",
       "3          NaN  81.2          NaN  81.3          NaN  81.4          NaN  81.5   \n",
       "4          NaN  58.1          NaN  58.8          NaN  59.4          NaN  59.9   \n",
       "\n",
       "   Unnamed: 55  2017  Unnamed: 57  2018 Unnamed: 59  \n",
       "0          NaN  64.1          NaN  64.5         NaN  \n",
       "1          NaN  78.3          NaN  78.5         NaN  \n",
       "2          NaN  76.5          NaN  76.7         NaN  \n",
       "3          NaN  81.7          NaN  81.8           a  \n",
       "4          NaN  60.4          NaN  60.8         NaN  "
      ]
     },
     "execution_count": 72,
     "metadata": {},
     "output_type": "execute_result"
    }
   ],
   "source": [
    "df_life.head()  #####################筛选我们需要的数据,太多年份了，我只要最新的数据"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 73,
   "metadata": {},
   "outputs": [
    {
     "name": "stdout",
     "output_type": "stream",
     "text": [
      "..\n",
      "..\n",
      "nan\n"
     ]
    },
    {
     "data": {
      "text/html": [
       "<div>\n",
       "<style scoped>\n",
       "    .dataframe tbody tr th:only-of-type {\n",
       "        vertical-align: middle;\n",
       "    }\n",
       "\n",
       "    .dataframe tbody tr th {\n",
       "        vertical-align: top;\n",
       "    }\n",
       "\n",
       "    .dataframe thead th {\n",
       "        text-align: right;\n",
       "    }\n",
       "</style>\n",
       "<table border=\"1\" class=\"dataframe\">\n",
       "  <thead>\n",
       "    <tr style=\"text-align: right;\">\n",
       "      <th></th>\n",
       "      <th>Country</th>\n",
       "      <th>2018</th>\n",
       "    </tr>\n",
       "  </thead>\n",
       "  <tbody>\n",
       "    <tr>\n",
       "      <th>0</th>\n",
       "      <td>Afghanistan</td>\n",
       "      <td>64.5</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>1</th>\n",
       "      <td>Albania</td>\n",
       "      <td>78.5</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>2</th>\n",
       "      <td>Algeria</td>\n",
       "      <td>76.7</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>3</th>\n",
       "      <td>Andorra</td>\n",
       "      <td>81.8</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>4</th>\n",
       "      <td>Angola</td>\n",
       "      <td>60.8</td>\n",
       "    </tr>\n",
       "  </tbody>\n",
       "</table>\n",
       "</div>"
      ],
      "text/plain": [
       "       Country  2018\n",
       "0  Afghanistan  64.5\n",
       "1      Albania  78.5\n",
       "2      Algeria  76.7\n",
       "3      Andorra  81.8\n",
       "4       Angola  60.8"
      ]
     },
     "execution_count": 73,
     "metadata": {},
     "output_type": "execute_result"
    }
   ],
   "source": [
    "tmp=df_life.iloc[:,1].values.tolist()\n",
    "df_life=df_life[[\"Country\",\"2018\"]]\n",
    "def func(x):\n",
    "    try:\n",
    "        x_new=float(x.replace(\",\",\"\"))\n",
    "    except:\n",
    "        print(x)\n",
    "        x_new=np.nan \n",
    "    return x_new\n",
    "df_life[\"2018\"]=df_life[\"2018\"].apply(lambda x:func(x))\n",
    "df_life.head()"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 74,
   "metadata": {},
   "outputs": [],
   "source": [
    "df_life = df_life[['Country', '2018']]\n",
    "df_life.columns = ['Country/Region', 'LifeExpectancy']  #############表头转换"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 149,
   "metadata": {},
   "outputs": [
    {
     "name": "stdout",
     "output_type": "stream",
     "text": [
      "30104\n"
     ]
    },
    {
     "data": {
      "text/html": [
       "<div>\n",
       "<style scoped>\n",
       "    .dataframe tbody tr th:only-of-type {\n",
       "        vertical-align: middle;\n",
       "    }\n",
       "\n",
       "    .dataframe tbody tr th {\n",
       "        vertical-align: top;\n",
       "    }\n",
       "\n",
       "    .dataframe thead th {\n",
       "        text-align: right;\n",
       "    }\n",
       "</style>\n",
       "<table border=\"1\" class=\"dataframe\">\n",
       "  <thead>\n",
       "    <tr style=\"text-align: right;\">\n",
       "      <th></th>\n",
       "      <th>Id</th>\n",
       "      <th>Province/State</th>\n",
       "      <th>Country/Region</th>\n",
       "      <th>Lat</th>\n",
       "      <th>Long</th>\n",
       "      <th>Date</th>\n",
       "      <th>ConfirmedCases</th>\n",
       "      <th>Fatalities</th>\n",
       "      <th>ForecastId</th>\n",
       "      <th>place_id</th>\n",
       "      <th>day</th>\n",
       "      <th>cases/day</th>\n",
       "      <th>fatal/day</th>\n",
       "      <th>cases/day-(1-1)</th>\n",
       "      <th>cases/day-(1-7)</th>\n",
       "      <th>cases/day-(8-14)</th>\n",
       "      <th>cases/day-(15-21)</th>\n",
       "      <th>fatal/day-(1-1)</th>\n",
       "      <th>fatal/day-(1-7)</th>\n",
       "      <th>fatal/day-(8-14)</th>\n",
       "      <th>fatal/day-(15-21)</th>\n",
       "      <th>days_since_1cases</th>\n",
       "      <th>days_since_10cases</th>\n",
       "      <th>days_since_100cases</th>\n",
       "      <th>days_since_1fatal</th>\n",
       "      <th>days_since_10fatal</th>\n",
       "      <th>days_since_100fatal</th>\n",
       "      <th>SmokingRate</th>\n",
       "      <th>Country</th>\n",
       "      <th>Gross_domestic_product__constant_prices</th>\n",
       "      <th>Gross_domestic_product__current_prices</th>\n",
       "      <th>Gross_domestic_product__deflator</th>\n",
       "      <th>Gross_domestic_product_per_capita__constant_prices</th>\n",
       "      <th>Gross_domestic_product_per_capita__current_prices</th>\n",
       "      <th>Output_gap_in_percent_of_potential_GDP</th>\n",
       "      <th>Gross_domestic_product_based_on_purchasing_power_parity__PPP__valuation_of_country_GDP</th>\n",
       "      <th>Gross_domestic_product_based_on_purchasing_power_parity__PPP__per_capita_GDP</th>\n",
       "      <th>Gross_domestic_product_based_on_purchasing_power_parity__PPP__share_of_world_total</th>\n",
       "      <th>Implied_PPP_conversion_rate</th>\n",
       "      <th>Total_investment</th>\n",
       "      <th>Gross_national_savings</th>\n",
       "      <th>Inflation__average_consumer_prices</th>\n",
       "      <th>Inflation__end_of_period_consumer_prices</th>\n",
       "      <th>Six_month_London_interbank_offered_rate__LIBOR_</th>\n",
       "      <th>Volume_of_imports_of_goods_and_services</th>\n",
       "      <th>Volume_of_Imports_of_goods</th>\n",
       "      <th>Volume_of_exports_of_goods_and_services</th>\n",
       "      <th>Volume_of_exports_of_goods</th>\n",
       "      <th>Unemployment_rate</th>\n",
       "      <th>Employment</th>\n",
       "      <th>Population</th>\n",
       "      <th>General_government_revenue</th>\n",
       "      <th>General_government_total_expenditure</th>\n",
       "      <th>General_government_net_lending_borrowing</th>\n",
       "      <th>General_government_structural_balance</th>\n",
       "      <th>General_government_primary_net_lending_borrowing</th>\n",
       "      <th>General_government_net_debt</th>\n",
       "      <th>General_government_gross_debt</th>\n",
       "      <th>Gross_domestic_product_corresponding_to_fiscal_year__current_prices</th>\n",
       "      <th>Current_account_balance</th>\n",
       "      <th>LifeExpectancy</th>\n",
       "    </tr>\n",
       "  </thead>\n",
       "  <tbody>\n",
       "    <tr>\n",
       "      <th>0</th>\n",
       "      <td>1.0</td>\n",
       "      <td>NaN</td>\n",
       "      <td>Afghanistan</td>\n",
       "      <td>33.0</td>\n",
       "      <td>65.0</td>\n",
       "      <td>2020-01-22</td>\n",
       "      <td>0.0</td>\n",
       "      <td>0.0</td>\n",
       "      <td>NaN</td>\n",
       "      <td>Afghanistan</td>\n",
       "      <td>22</td>\n",
       "      <td>0</td>\n",
       "      <td>0</td>\n",
       "      <td>0.0</td>\n",
       "      <td>0.0</td>\n",
       "      <td>0.0</td>\n",
       "      <td>0.0</td>\n",
       "      <td>0.0</td>\n",
       "      <td>0.0</td>\n",
       "      <td>0.0</td>\n",
       "      <td>0.0</td>\n",
       "      <td>0</td>\n",
       "      <td>0</td>\n",
       "      <td>0</td>\n",
       "      <td>0</td>\n",
       "      <td>0</td>\n",
       "      <td>0</td>\n",
       "      <td>20.475517</td>\n",
       "      <td>Afghanistan</td>\n",
       "      <td>528.154</td>\n",
       "      <td>1,692.57</td>\n",
       "      <td>320.469</td>\n",
       "      <td>14,300.19</td>\n",
       "      <td>45,827.64</td>\n",
       "      <td>NaN</td>\n",
       "      <td>75.87</td>\n",
       "      <td>2,054.23</td>\n",
       "      <td>0.053</td>\n",
       "      <td>22.309</td>\n",
       "      <td>18.346</td>\n",
       "      <td>20.174</td>\n",
       "      <td>124.809</td>\n",
       "      <td>131.29</td>\n",
       "      <td>NaN</td>\n",
       "      <td>3.559</td>\n",
       "      <td>2.773</td>\n",
       "      <td>13.252</td>\n",
       "      <td>17.026</td>\n",
       "      <td>NaN</td>\n",
       "      <td>NaN</td>\n",
       "      <td>36.933</td>\n",
       "      <td>469.79</td>\n",
       "      <td>467.62</td>\n",
       "      <td>2.17</td>\n",
       "      <td>NaN</td>\n",
       "      <td>2.532</td>\n",
       "      <td>NaN</td>\n",
       "      <td>101.669</td>\n",
       "      <td>1,692.57</td>\n",
       "      <td>0.425</td>\n",
       "      <td>64.5</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>1</th>\n",
       "      <td>2.0</td>\n",
       "      <td>NaN</td>\n",
       "      <td>Afghanistan</td>\n",
       "      <td>33.0</td>\n",
       "      <td>65.0</td>\n",
       "      <td>2020-01-23</td>\n",
       "      <td>0.0</td>\n",
       "      <td>0.0</td>\n",
       "      <td>NaN</td>\n",
       "      <td>Afghanistan</td>\n",
       "      <td>23</td>\n",
       "      <td>0</td>\n",
       "      <td>0</td>\n",
       "      <td>0.0</td>\n",
       "      <td>0.0</td>\n",
       "      <td>0.0</td>\n",
       "      <td>0.0</td>\n",
       "      <td>0.0</td>\n",
       "      <td>0.0</td>\n",
       "      <td>0.0</td>\n",
       "      <td>0.0</td>\n",
       "      <td>0</td>\n",
       "      <td>0</td>\n",
       "      <td>0</td>\n",
       "      <td>0</td>\n",
       "      <td>0</td>\n",
       "      <td>0</td>\n",
       "      <td>20.475517</td>\n",
       "      <td>Afghanistan</td>\n",
       "      <td>528.154</td>\n",
       "      <td>1,692.57</td>\n",
       "      <td>320.469</td>\n",
       "      <td>14,300.19</td>\n",
       "      <td>45,827.64</td>\n",
       "      <td>NaN</td>\n",
       "      <td>75.87</td>\n",
       "      <td>2,054.23</td>\n",
       "      <td>0.053</td>\n",
       "      <td>22.309</td>\n",
       "      <td>18.346</td>\n",
       "      <td>20.174</td>\n",
       "      <td>124.809</td>\n",
       "      <td>131.29</td>\n",
       "      <td>NaN</td>\n",
       "      <td>3.559</td>\n",
       "      <td>2.773</td>\n",
       "      <td>13.252</td>\n",
       "      <td>17.026</td>\n",
       "      <td>NaN</td>\n",
       "      <td>NaN</td>\n",
       "      <td>36.933</td>\n",
       "      <td>469.79</td>\n",
       "      <td>467.62</td>\n",
       "      <td>2.17</td>\n",
       "      <td>NaN</td>\n",
       "      <td>2.532</td>\n",
       "      <td>NaN</td>\n",
       "      <td>101.669</td>\n",
       "      <td>1,692.57</td>\n",
       "      <td>0.425</td>\n",
       "      <td>64.5</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>2</th>\n",
       "      <td>3.0</td>\n",
       "      <td>NaN</td>\n",
       "      <td>Afghanistan</td>\n",
       "      <td>33.0</td>\n",
       "      <td>65.0</td>\n",
       "      <td>2020-01-24</td>\n",
       "      <td>0.0</td>\n",
       "      <td>0.0</td>\n",
       "      <td>NaN</td>\n",
       "      <td>Afghanistan</td>\n",
       "      <td>24</td>\n",
       "      <td>0</td>\n",
       "      <td>0</td>\n",
       "      <td>0.0</td>\n",
       "      <td>0.0</td>\n",
       "      <td>0.0</td>\n",
       "      <td>0.0</td>\n",
       "      <td>0.0</td>\n",
       "      <td>0.0</td>\n",
       "      <td>0.0</td>\n",
       "      <td>0.0</td>\n",
       "      <td>0</td>\n",
       "      <td>0</td>\n",
       "      <td>0</td>\n",
       "      <td>0</td>\n",
       "      <td>0</td>\n",
       "      <td>0</td>\n",
       "      <td>20.475517</td>\n",
       "      <td>Afghanistan</td>\n",
       "      <td>528.154</td>\n",
       "      <td>1,692.57</td>\n",
       "      <td>320.469</td>\n",
       "      <td>14,300.19</td>\n",
       "      <td>45,827.64</td>\n",
       "      <td>NaN</td>\n",
       "      <td>75.87</td>\n",
       "      <td>2,054.23</td>\n",
       "      <td>0.053</td>\n",
       "      <td>22.309</td>\n",
       "      <td>18.346</td>\n",
       "      <td>20.174</td>\n",
       "      <td>124.809</td>\n",
       "      <td>131.29</td>\n",
       "      <td>NaN</td>\n",
       "      <td>3.559</td>\n",
       "      <td>2.773</td>\n",
       "      <td>13.252</td>\n",
       "      <td>17.026</td>\n",
       "      <td>NaN</td>\n",
       "      <td>NaN</td>\n",
       "      <td>36.933</td>\n",
       "      <td>469.79</td>\n",
       "      <td>467.62</td>\n",
       "      <td>2.17</td>\n",
       "      <td>NaN</td>\n",
       "      <td>2.532</td>\n",
       "      <td>NaN</td>\n",
       "      <td>101.669</td>\n",
       "      <td>1,692.57</td>\n",
       "      <td>0.425</td>\n",
       "      <td>64.5</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>3</th>\n",
       "      <td>4.0</td>\n",
       "      <td>NaN</td>\n",
       "      <td>Afghanistan</td>\n",
       "      <td>33.0</td>\n",
       "      <td>65.0</td>\n",
       "      <td>2020-01-25</td>\n",
       "      <td>0.0</td>\n",
       "      <td>0.0</td>\n",
       "      <td>NaN</td>\n",
       "      <td>Afghanistan</td>\n",
       "      <td>25</td>\n",
       "      <td>0</td>\n",
       "      <td>0</td>\n",
       "      <td>0.0</td>\n",
       "      <td>0.0</td>\n",
       "      <td>0.0</td>\n",
       "      <td>0.0</td>\n",
       "      <td>0.0</td>\n",
       "      <td>0.0</td>\n",
       "      <td>0.0</td>\n",
       "      <td>0.0</td>\n",
       "      <td>0</td>\n",
       "      <td>0</td>\n",
       "      <td>0</td>\n",
       "      <td>0</td>\n",
       "      <td>0</td>\n",
       "      <td>0</td>\n",
       "      <td>20.475517</td>\n",
       "      <td>Afghanistan</td>\n",
       "      <td>528.154</td>\n",
       "      <td>1,692.57</td>\n",
       "      <td>320.469</td>\n",
       "      <td>14,300.19</td>\n",
       "      <td>45,827.64</td>\n",
       "      <td>NaN</td>\n",
       "      <td>75.87</td>\n",
       "      <td>2,054.23</td>\n",
       "      <td>0.053</td>\n",
       "      <td>22.309</td>\n",
       "      <td>18.346</td>\n",
       "      <td>20.174</td>\n",
       "      <td>124.809</td>\n",
       "      <td>131.29</td>\n",
       "      <td>NaN</td>\n",
       "      <td>3.559</td>\n",
       "      <td>2.773</td>\n",
       "      <td>13.252</td>\n",
       "      <td>17.026</td>\n",
       "      <td>NaN</td>\n",
       "      <td>NaN</td>\n",
       "      <td>36.933</td>\n",
       "      <td>469.79</td>\n",
       "      <td>467.62</td>\n",
       "      <td>2.17</td>\n",
       "      <td>NaN</td>\n",
       "      <td>2.532</td>\n",
       "      <td>NaN</td>\n",
       "      <td>101.669</td>\n",
       "      <td>1,692.57</td>\n",
       "      <td>0.425</td>\n",
       "      <td>64.5</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>4</th>\n",
       "      <td>5.0</td>\n",
       "      <td>NaN</td>\n",
       "      <td>Afghanistan</td>\n",
       "      <td>33.0</td>\n",
       "      <td>65.0</td>\n",
       "      <td>2020-01-26</td>\n",
       "      <td>0.0</td>\n",
       "      <td>0.0</td>\n",
       "      <td>NaN</td>\n",
       "      <td>Afghanistan</td>\n",
       "      <td>26</td>\n",
       "      <td>0</td>\n",
       "      <td>0</td>\n",
       "      <td>0.0</td>\n",
       "      <td>0.0</td>\n",
       "      <td>0.0</td>\n",
       "      <td>0.0</td>\n",
       "      <td>0.0</td>\n",
       "      <td>0.0</td>\n",
       "      <td>0.0</td>\n",
       "      <td>0.0</td>\n",
       "      <td>0</td>\n",
       "      <td>0</td>\n",
       "      <td>0</td>\n",
       "      <td>0</td>\n",
       "      <td>0</td>\n",
       "      <td>0</td>\n",
       "      <td>20.475517</td>\n",
       "      <td>Afghanistan</td>\n",
       "      <td>528.154</td>\n",
       "      <td>1,692.57</td>\n",
       "      <td>320.469</td>\n",
       "      <td>14,300.19</td>\n",
       "      <td>45,827.64</td>\n",
       "      <td>NaN</td>\n",
       "      <td>75.87</td>\n",
       "      <td>2,054.23</td>\n",
       "      <td>0.053</td>\n",
       "      <td>22.309</td>\n",
       "      <td>18.346</td>\n",
       "      <td>20.174</td>\n",
       "      <td>124.809</td>\n",
       "      <td>131.29</td>\n",
       "      <td>NaN</td>\n",
       "      <td>3.559</td>\n",
       "      <td>2.773</td>\n",
       "      <td>13.252</td>\n",
       "      <td>17.026</td>\n",
       "      <td>NaN</td>\n",
       "      <td>NaN</td>\n",
       "      <td>36.933</td>\n",
       "      <td>469.79</td>\n",
       "      <td>467.62</td>\n",
       "      <td>2.17</td>\n",
       "      <td>NaN</td>\n",
       "      <td>2.532</td>\n",
       "      <td>NaN</td>\n",
       "      <td>101.669</td>\n",
       "      <td>1,692.57</td>\n",
       "      <td>0.425</td>\n",
       "      <td>64.5</td>\n",
       "    </tr>\n",
       "  </tbody>\n",
       "</table>\n",
       "</div>"
      ],
      "text/plain": [
       "    Id Province/State Country/Region   Lat  Long       Date  ConfirmedCases  \\\n",
       "0  1.0            NaN    Afghanistan  33.0  65.0 2020-01-22             0.0   \n",
       "1  2.0            NaN    Afghanistan  33.0  65.0 2020-01-23             0.0   \n",
       "2  3.0            NaN    Afghanistan  33.0  65.0 2020-01-24             0.0   \n",
       "3  4.0            NaN    Afghanistan  33.0  65.0 2020-01-25             0.0   \n",
       "4  5.0            NaN    Afghanistan  33.0  65.0 2020-01-26             0.0   \n",
       "\n",
       "   Fatalities  ForecastId     place_id  day  cases/day  fatal/day  \\\n",
       "0         0.0         NaN  Afghanistan   22          0          0   \n",
       "1         0.0         NaN  Afghanistan   23          0          0   \n",
       "2         0.0         NaN  Afghanistan   24          0          0   \n",
       "3         0.0         NaN  Afghanistan   25          0          0   \n",
       "4         0.0         NaN  Afghanistan   26          0          0   \n",
       "\n",
       "   cases/day-(1-1)  cases/day-(1-7)  cases/day-(8-14)  cases/day-(15-21)  \\\n",
       "0              0.0              0.0               0.0                0.0   \n",
       "1              0.0              0.0               0.0                0.0   \n",
       "2              0.0              0.0               0.0                0.0   \n",
       "3              0.0              0.0               0.0                0.0   \n",
       "4              0.0              0.0               0.0                0.0   \n",
       "\n",
       "   fatal/day-(1-1)  fatal/day-(1-7)  fatal/day-(8-14)  fatal/day-(15-21)  \\\n",
       "0              0.0              0.0               0.0                0.0   \n",
       "1              0.0              0.0               0.0                0.0   \n",
       "2              0.0              0.0               0.0                0.0   \n",
       "3              0.0              0.0               0.0                0.0   \n",
       "4              0.0              0.0               0.0                0.0   \n",
       "\n",
       "   days_since_1cases  days_since_10cases  days_since_100cases  \\\n",
       "0                  0                   0                    0   \n",
       "1                  0                   0                    0   \n",
       "2                  0                   0                    0   \n",
       "3                  0                   0                    0   \n",
       "4                  0                   0                    0   \n",
       "\n",
       "   days_since_1fatal  days_since_10fatal  days_since_100fatal  SmokingRate  \\\n",
       "0                  0                   0                    0    20.475517   \n",
       "1                  0                   0                    0    20.475517   \n",
       "2                  0                   0                    0    20.475517   \n",
       "3                  0                   0                    0    20.475517   \n",
       "4                  0                   0                    0    20.475517   \n",
       "\n",
       "       Country Gross_domestic_product__constant_prices  \\\n",
       "0  Afghanistan                                 528.154   \n",
       "1  Afghanistan                                 528.154   \n",
       "2  Afghanistan                                 528.154   \n",
       "3  Afghanistan                                 528.154   \n",
       "4  Afghanistan                                 528.154   \n",
       "\n",
       "  Gross_domestic_product__current_prices Gross_domestic_product__deflator  \\\n",
       "0                               1,692.57                          320.469   \n",
       "1                               1,692.57                          320.469   \n",
       "2                               1,692.57                          320.469   \n",
       "3                               1,692.57                          320.469   \n",
       "4                               1,692.57                          320.469   \n",
       "\n",
       "  Gross_domestic_product_per_capita__constant_prices  \\\n",
       "0                                          14,300.19   \n",
       "1                                          14,300.19   \n",
       "2                                          14,300.19   \n",
       "3                                          14,300.19   \n",
       "4                                          14,300.19   \n",
       "\n",
       "  Gross_domestic_product_per_capita__current_prices  \\\n",
       "0                                         45,827.64   \n",
       "1                                         45,827.64   \n",
       "2                                         45,827.64   \n",
       "3                                         45,827.64   \n",
       "4                                         45,827.64   \n",
       "\n",
       "  Output_gap_in_percent_of_potential_GDP  \\\n",
       "0                                    NaN   \n",
       "1                                    NaN   \n",
       "2                                    NaN   \n",
       "3                                    NaN   \n",
       "4                                    NaN   \n",
       "\n",
       "  Gross_domestic_product_based_on_purchasing_power_parity__PPP__valuation_of_country_GDP  \\\n",
       "0                                              75.87                                       \n",
       "1                                              75.87                                       \n",
       "2                                              75.87                                       \n",
       "3                                              75.87                                       \n",
       "4                                              75.87                                       \n",
       "\n",
       "  Gross_domestic_product_based_on_purchasing_power_parity__PPP__per_capita_GDP  \\\n",
       "0                                           2,054.23                             \n",
       "1                                           2,054.23                             \n",
       "2                                           2,054.23                             \n",
       "3                                           2,054.23                             \n",
       "4                                           2,054.23                             \n",
       "\n",
       "  Gross_domestic_product_based_on_purchasing_power_parity__PPP__share_of_world_total  \\\n",
       "0                                              0.053                                   \n",
       "1                                              0.053                                   \n",
       "2                                              0.053                                   \n",
       "3                                              0.053                                   \n",
       "4                                              0.053                                   \n",
       "\n",
       "  Implied_PPP_conversion_rate Total_investment Gross_national_savings  \\\n",
       "0                      22.309           18.346                 20.174   \n",
       "1                      22.309           18.346                 20.174   \n",
       "2                      22.309           18.346                 20.174   \n",
       "3                      22.309           18.346                 20.174   \n",
       "4                      22.309           18.346                 20.174   \n",
       "\n",
       "  Inflation__average_consumer_prices Inflation__end_of_period_consumer_prices  \\\n",
       "0                            124.809                                   131.29   \n",
       "1                            124.809                                   131.29   \n",
       "2                            124.809                                   131.29   \n",
       "3                            124.809                                   131.29   \n",
       "4                            124.809                                   131.29   \n",
       "\n",
       "  Six_month_London_interbank_offered_rate__LIBOR_  \\\n",
       "0                                             NaN   \n",
       "1                                             NaN   \n",
       "2                                             NaN   \n",
       "3                                             NaN   \n",
       "4                                             NaN   \n",
       "\n",
       "  Volume_of_imports_of_goods_and_services Volume_of_Imports_of_goods  \\\n",
       "0                                   3.559                      2.773   \n",
       "1                                   3.559                      2.773   \n",
       "2                                   3.559                      2.773   \n",
       "3                                   3.559                      2.773   \n",
       "4                                   3.559                      2.773   \n",
       "\n",
       "  Volume_of_exports_of_goods_and_services Volume_of_exports_of_goods  \\\n",
       "0                                  13.252                     17.026   \n",
       "1                                  13.252                     17.026   \n",
       "2                                  13.252                     17.026   \n",
       "3                                  13.252                     17.026   \n",
       "4                                  13.252                     17.026   \n",
       "\n",
       "  Unemployment_rate Employment Population General_government_revenue  \\\n",
       "0               NaN        NaN     36.933                     469.79   \n",
       "1               NaN        NaN     36.933                     469.79   \n",
       "2               NaN        NaN     36.933                     469.79   \n",
       "3               NaN        NaN     36.933                     469.79   \n",
       "4               NaN        NaN     36.933                     469.79   \n",
       "\n",
       "  General_government_total_expenditure  \\\n",
       "0                               467.62   \n",
       "1                               467.62   \n",
       "2                               467.62   \n",
       "3                               467.62   \n",
       "4                               467.62   \n",
       "\n",
       "  General_government_net_lending_borrowing  \\\n",
       "0                                     2.17   \n",
       "1                                     2.17   \n",
       "2                                     2.17   \n",
       "3                                     2.17   \n",
       "4                                     2.17   \n",
       "\n",
       "  General_government_structural_balance  \\\n",
       "0                                   NaN   \n",
       "1                                   NaN   \n",
       "2                                   NaN   \n",
       "3                                   NaN   \n",
       "4                                   NaN   \n",
       "\n",
       "  General_government_primary_net_lending_borrowing  \\\n",
       "0                                            2.532   \n",
       "1                                            2.532   \n",
       "2                                            2.532   \n",
       "3                                            2.532   \n",
       "4                                            2.532   \n",
       "\n",
       "  General_government_net_debt General_government_gross_debt  \\\n",
       "0                         NaN                       101.669   \n",
       "1                         NaN                       101.669   \n",
       "2                         NaN                       101.669   \n",
       "3                         NaN                       101.669   \n",
       "4                         NaN                       101.669   \n",
       "\n",
       "  Gross_domestic_product_corresponding_to_fiscal_year__current_prices  \\\n",
       "0                                           1,692.57                    \n",
       "1                                           1,692.57                    \n",
       "2                                           1,692.57                    \n",
       "3                                           1,692.57                    \n",
       "4                                           1,692.57                    \n",
       "\n",
       "  Current_account_balance  LifeExpectancy  \n",
       "0                   0.425            64.5  \n",
       "1                   0.425            64.5  \n",
       "2                   0.425            64.5  \n",
       "3                   0.425            64.5  \n",
       "4                   0.425            64.5  "
      ]
     },
     "execution_count": 149,
     "metadata": {},
     "output_type": "execute_result"
    }
   ],
   "source": [
    "df_traintest6 = pd.merge(df_traintest5, df_life, on='Country/Region', how='left')\n",
    "print(len(df_traintest6))\n",
    "df_traintest6.head()"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 64,
   "metadata": {},
   "outputs": [],
   "source": [
    "#########################引入Kaggle提供的关于各个国家实际情况的数据库：covid19countryinfo\n",
    "########################总结一下数据大概就是：\n",
    "########################人口,每天能提供的测纸数目,测温枪,人口密度,年龄中位数，检疫措施，城镇居住人口比例，以及各个年龄段的男女性别比例数据\n",
    "########################当地政府初步提出检政策的日期,初步提出学校关停的日期\n",
    "#######################男女各死于肺部疾病每千人的数目已经每1000人拥有的床位数"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 76,
   "metadata": {},
   "outputs": [
    {
     "data": {
      "text/html": [
       "<div>\n",
       "<style scoped>\n",
       "    .dataframe tbody tr th:only-of-type {\n",
       "        vertical-align: middle;\n",
       "    }\n",
       "\n",
       "    .dataframe tbody tr th {\n",
       "        vertical-align: top;\n",
       "    }\n",
       "\n",
       "    .dataframe thead th {\n",
       "        text-align: right;\n",
       "    }\n",
       "</style>\n",
       "<table border=\"1\" class=\"dataframe\">\n",
       "  <thead>\n",
       "    <tr style=\"text-align: right;\">\n",
       "      <th></th>\n",
       "      <th>country</th>\n",
       "      <th>pop</th>\n",
       "      <th>tests</th>\n",
       "      <th>testpop</th>\n",
       "      <th>density</th>\n",
       "      <th>medianage</th>\n",
       "      <th>urbanpop</th>\n",
       "      <th>quarantine</th>\n",
       "      <th>schools</th>\n",
       "      <th>hospibed</th>\n",
       "      <th>smokers</th>\n",
       "      <th>sex0</th>\n",
       "      <th>sex14</th>\n",
       "      <th>sex25</th>\n",
       "      <th>sex54</th>\n",
       "      <th>sex64</th>\n",
       "      <th>sex65plus</th>\n",
       "      <th>sexratio</th>\n",
       "      <th>lung</th>\n",
       "      <th>femalelung</th>\n",
       "      <th>malelung</th>\n",
       "    </tr>\n",
       "  </thead>\n",
       "  <tbody>\n",
       "    <tr>\n",
       "      <th>0</th>\n",
       "      <td>Afghanistan</td>\n",
       "      <td>38,928,346</td>\n",
       "      <td>NaN</td>\n",
       "      <td>NaN</td>\n",
       "      <td>60.0</td>\n",
       "      <td>18.0</td>\n",
       "      <td>25.0</td>\n",
       "      <td>NaN</td>\n",
       "      <td>NaN</td>\n",
       "      <td>0.5</td>\n",
       "      <td>NaN</td>\n",
       "      <td>1.05</td>\n",
       "      <td>1.03</td>\n",
       "      <td>1.03</td>\n",
       "      <td>1.03</td>\n",
       "      <td>0.97</td>\n",
       "      <td>0.85</td>\n",
       "      <td>1.03</td>\n",
       "      <td>37.62</td>\n",
       "      <td>36.31</td>\n",
       "      <td>39.33</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>1</th>\n",
       "      <td>Albania</td>\n",
       "      <td>2,877,797</td>\n",
       "      <td>NaN</td>\n",
       "      <td>NaN</td>\n",
       "      <td>105.0</td>\n",
       "      <td>36.0</td>\n",
       "      <td>63.0</td>\n",
       "      <td>NaN</td>\n",
       "      <td>NaN</td>\n",
       "      <td>2.9</td>\n",
       "      <td>29.4</td>\n",
       "      <td>1.08</td>\n",
       "      <td>1.11</td>\n",
       "      <td>1.09</td>\n",
       "      <td>0.93</td>\n",
       "      <td>0.95</td>\n",
       "      <td>0.87</td>\n",
       "      <td>0.98</td>\n",
       "      <td>11.67</td>\n",
       "      <td>7.02</td>\n",
       "      <td>17.04</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>2</th>\n",
       "      <td>Algeria</td>\n",
       "      <td>43,851,044</td>\n",
       "      <td>NaN</td>\n",
       "      <td>NaN</td>\n",
       "      <td>18.0</td>\n",
       "      <td>29.0</td>\n",
       "      <td>73.0</td>\n",
       "      <td>NaN</td>\n",
       "      <td>NaN</td>\n",
       "      <td>1.9</td>\n",
       "      <td>NaN</td>\n",
       "      <td>1.05</td>\n",
       "      <td>1.05</td>\n",
       "      <td>1.05</td>\n",
       "      <td>1.03</td>\n",
       "      <td>1.01</td>\n",
       "      <td>0.89</td>\n",
       "      <td>1.03</td>\n",
       "      <td>8.77</td>\n",
       "      <td>5.03</td>\n",
       "      <td>12.81</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>3</th>\n",
       "      <td>Andorra</td>\n",
       "      <td>77,265</td>\n",
       "      <td>NaN</td>\n",
       "      <td>NaN</td>\n",
       "      <td>164.0</td>\n",
       "      <td>45.0</td>\n",
       "      <td>88.0</td>\n",
       "      <td>NaN</td>\n",
       "      <td>NaN</td>\n",
       "      <td>2.5</td>\n",
       "      <td>32.5</td>\n",
       "      <td>1.07</td>\n",
       "      <td>1.05</td>\n",
       "      <td>1.08</td>\n",
       "      <td>1.05</td>\n",
       "      <td>1.15</td>\n",
       "      <td>1.02</td>\n",
       "      <td>1.06</td>\n",
       "      <td>NaN</td>\n",
       "      <td>NaN</td>\n",
       "      <td>NaN</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>4</th>\n",
       "      <td>Antigua and Barbuda</td>\n",
       "      <td>97,929</td>\n",
       "      <td>NaN</td>\n",
       "      <td>NaN</td>\n",
       "      <td>223.0</td>\n",
       "      <td>34.0</td>\n",
       "      <td>26.0</td>\n",
       "      <td>NaN</td>\n",
       "      <td>NaN</td>\n",
       "      <td>3.8</td>\n",
       "      <td>NaN</td>\n",
       "      <td>1.05</td>\n",
       "      <td>1.03</td>\n",
       "      <td>0.99</td>\n",
       "      <td>0.84</td>\n",
       "      <td>0.82</td>\n",
       "      <td>0.76</td>\n",
       "      <td>0.90</td>\n",
       "      <td>11.76</td>\n",
       "      <td>7.67</td>\n",
       "      <td>18.78</td>\n",
       "    </tr>\n",
       "  </tbody>\n",
       "</table>\n",
       "</div>"
      ],
      "text/plain": [
       "               country         pop  tests  testpop  density  medianage  \\\n",
       "0          Afghanistan  38,928,346    NaN      NaN     60.0       18.0   \n",
       "1              Albania   2,877,797    NaN      NaN    105.0       36.0   \n",
       "2              Algeria  43,851,044    NaN      NaN     18.0       29.0   \n",
       "3              Andorra      77,265    NaN      NaN    164.0       45.0   \n",
       "4  Antigua and Barbuda      97,929    NaN      NaN    223.0       34.0   \n",
       "\n",
       "   urbanpop quarantine schools  hospibed  smokers  sex0  sex14  sex25  sex54  \\\n",
       "0      25.0        NaN     NaN       0.5      NaN  1.05   1.03   1.03   1.03   \n",
       "1      63.0        NaN     NaN       2.9     29.4  1.08   1.11   1.09   0.93   \n",
       "2      73.0        NaN     NaN       1.9      NaN  1.05   1.05   1.05   1.03   \n",
       "3      88.0        NaN     NaN       2.5     32.5  1.07   1.05   1.08   1.05   \n",
       "4      26.0        NaN     NaN       3.8      NaN  1.05   1.03   0.99   0.84   \n",
       "\n",
       "   sex64  sex65plus  sexratio   lung  femalelung  malelung  \n",
       "0   0.97       0.85      1.03  37.62       36.31     39.33  \n",
       "1   0.95       0.87      0.98  11.67        7.02     17.04  \n",
       "2   1.01       0.89      1.03   8.77        5.03     12.81  \n",
       "3   1.15       1.02      1.06    NaN         NaN       NaN  \n",
       "4   0.82       0.76      0.90  11.76        7.67     18.78  "
      ]
     },
     "execution_count": 76,
     "metadata": {},
     "output_type": "execute_result"
    }
   ],
   "source": [
    "df_country = pd.read_csv(\"F:\\kaggle\\covid-first\\covid19countryinfo.csv\")[[\"country\",\"pop\",\"tests\",\"testpop\",\"density\",\"medianage\",\"urbanpop\",\"quarantine\",\"schools\",\"hospibed\",\"smokers\",\"sex0\",\"sex14\",\"sex25\",\"sex54\",\"sex64\",\"sex65plus\",\"sexratio\",\"lung\",\"femalelung\",\"malelung\"]]\n",
    "df_country.head() "
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 77,
   "metadata": {},
   "outputs": [
    {
     "data": {
      "text/plain": [
       "33     56.35\n",
       "110      NaN\n",
       "192      NaN\n",
       "193      NaN\n",
       "Name: femalelung, dtype: float64"
      ]
     },
     "execution_count": 77,
     "metadata": {},
     "output_type": "execute_result"
    }
   ],
   "source": [
    "df_country[\"femalelung\"][df_country[\"country\"]==\"China\"] ####################中国，中国香港，中国澳门，湖北特别疫情地区"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 78,
   "metadata": {},
   "outputs": [],
   "source": [
    "df_country[\"Country/Region\"]=df_country[\"country\"]\n",
    "df_country=df_country[df_country[\"country\"].duplicated()==False]    ############把不同的称呼的同一地区合并"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 79,
   "metadata": {},
   "outputs": [
    {
     "name": "stdout",
     "output_type": "stream",
     "text": [
      "(0, 22)\n"
     ]
    }
   ],
   "source": [
    "print(df_country[df_country['country'].duplicated()].shape)    ############确认无重复"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 80,
   "metadata": {},
   "outputs": [
    {
     "data": {
      "text/plain": [
       "33    56.35\n",
       "Name: femalelung, dtype: float64"
      ]
     },
     "execution_count": 80,
     "metadata": {},
     "output_type": "execute_result"
    }
   ],
   "source": [
    "df_country[\"femalelung\"][df_country[\"Country/Region\"]==\"China\"]       #####中国地区数据变成了香港的NaN\n",
    "####手动删除香港  "
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 81,
   "metadata": {},
   "outputs": [
    {
     "data": {
      "text/plain": [
       "33    56.35\n",
       "Name: femalelung, dtype: float64"
      ]
     },
     "execution_count": 81,
     "metadata": {},
     "output_type": "execute_result"
    }
   ],
   "source": [
    "df_country[\"femalelung\"][df_country[\"Country/Region\"]==\"China\"]    ###########正常数据"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 82,
   "metadata": {},
   "outputs": [
    {
     "name": "stdout",
     "output_type": "stream",
     "text": [
      "(30104, 79)\n"
     ]
    },
    {
     "data": {
      "text/html": [
       "<div>\n",
       "<style scoped>\n",
       "    .dataframe tbody tr th:only-of-type {\n",
       "        vertical-align: middle;\n",
       "    }\n",
       "\n",
       "    .dataframe tbody tr th {\n",
       "        vertical-align: top;\n",
       "    }\n",
       "\n",
       "    .dataframe thead th {\n",
       "        text-align: right;\n",
       "    }\n",
       "</style>\n",
       "<table border=\"1\" class=\"dataframe\">\n",
       "  <thead>\n",
       "    <tr style=\"text-align: right;\">\n",
       "      <th></th>\n",
       "      <th>Id</th>\n",
       "      <th>Province/State</th>\n",
       "      <th>Country/Region</th>\n",
       "      <th>Lat</th>\n",
       "      <th>Long</th>\n",
       "      <th>Date</th>\n",
       "      <th>ConfirmedCases</th>\n",
       "      <th>Fatalities</th>\n",
       "      <th>ForecastId</th>\n",
       "      <th>place_id</th>\n",
       "      <th>day</th>\n",
       "      <th>cases/day</th>\n",
       "      <th>fatal/day</th>\n",
       "      <th>cases/day-(1-1)</th>\n",
       "      <th>cases/day-(1-7)</th>\n",
       "      <th>cases/day-(8-14)</th>\n",
       "      <th>cases/day-(15-21)</th>\n",
       "      <th>fatal/day-(1-1)</th>\n",
       "      <th>fatal/day-(1-7)</th>\n",
       "      <th>fatal/day-(8-14)</th>\n",
       "      <th>fatal/day-(15-21)</th>\n",
       "      <th>days_since_1cases</th>\n",
       "      <th>days_since_10cases</th>\n",
       "      <th>days_since_100cases</th>\n",
       "      <th>days_since_1fatal</th>\n",
       "      <th>days_since_10fatal</th>\n",
       "      <th>days_since_100fatal</th>\n",
       "      <th>SmokingRate</th>\n",
       "      <th>Country</th>\n",
       "      <th>Gross_domestic_product__constant_prices</th>\n",
       "      <th>Gross_domestic_product__current_prices</th>\n",
       "      <th>Gross_domestic_product__deflator</th>\n",
       "      <th>Gross_domestic_product_per_capita__constant_prices</th>\n",
       "      <th>Gross_domestic_product_per_capita__current_prices</th>\n",
       "      <th>Output_gap_in_percent_of_potential_GDP</th>\n",
       "      <th>Gross_domestic_product_based_on_purchasing_power_parity__PPP__valuation_of_country_GDP</th>\n",
       "      <th>Gross_domestic_product_based_on_purchasing_power_parity__PPP__per_capita_GDP</th>\n",
       "      <th>Gross_domestic_product_based_on_purchasing_power_parity__PPP__share_of_world_total</th>\n",
       "      <th>Implied_PPP_conversion_rate</th>\n",
       "      <th>Total_investment</th>\n",
       "      <th>Gross_national_savings</th>\n",
       "      <th>Inflation__average_consumer_prices</th>\n",
       "      <th>Inflation__end_of_period_consumer_prices</th>\n",
       "      <th>Six_month_London_interbank_offered_rate__LIBOR_</th>\n",
       "      <th>Volume_of_imports_of_goods_and_services</th>\n",
       "      <th>Volume_of_Imports_of_goods</th>\n",
       "      <th>Volume_of_exports_of_goods_and_services</th>\n",
       "      <th>Volume_of_exports_of_goods</th>\n",
       "      <th>Unemployment_rate</th>\n",
       "      <th>Employment</th>\n",
       "      <th>Population</th>\n",
       "      <th>General_government_revenue</th>\n",
       "      <th>General_government_total_expenditure</th>\n",
       "      <th>General_government_net_lending_borrowing</th>\n",
       "      <th>General_government_structural_balance</th>\n",
       "      <th>General_government_primary_net_lending_borrowing</th>\n",
       "      <th>General_government_net_debt</th>\n",
       "      <th>General_government_gross_debt</th>\n",
       "      <th>Gross_domestic_product_corresponding_to_fiscal_year__current_prices</th>\n",
       "      <th>Current_account_balance</th>\n",
       "      <th>LifeExpectancy</th>\n",
       "      <th>pop</th>\n",
       "      <th>density</th>\n",
       "      <th>medianage</th>\n",
       "      <th>urbanpop</th>\n",
       "      <th>quarantine</th>\n",
       "      <th>schools</th>\n",
       "      <th>hospibed</th>\n",
       "      <th>smokers</th>\n",
       "      <th>sex0</th>\n",
       "      <th>sex14</th>\n",
       "      <th>sex25</th>\n",
       "      <th>sex54</th>\n",
       "      <th>sex64</th>\n",
       "      <th>sex65plus</th>\n",
       "      <th>sexratio</th>\n",
       "      <th>lung</th>\n",
       "      <th>femalelung</th>\n",
       "      <th>malelung</th>\n",
       "    </tr>\n",
       "  </thead>\n",
       "  <tbody>\n",
       "    <tr>\n",
       "      <th>4982</th>\n",
       "      <td>4372.0</td>\n",
       "      <td>Anhui</td>\n",
       "      <td>China</td>\n",
       "      <td>31.8257</td>\n",
       "      <td>117.2264</td>\n",
       "      <td>2020-01-22</td>\n",
       "      <td>1.0</td>\n",
       "      <td>0.0</td>\n",
       "      <td>NaN</td>\n",
       "      <td>China/Anhui</td>\n",
       "      <td>22</td>\n",
       "      <td>1</td>\n",
       "      <td>0</td>\n",
       "      <td>0.000000e+00</td>\n",
       "      <td>0.000000e+00</td>\n",
       "      <td>0.000000e+00</td>\n",
       "      <td>0.000000e+00</td>\n",
       "      <td>0.000000e+00</td>\n",
       "      <td>0.000000e+00</td>\n",
       "      <td>0.000000e+00</td>\n",
       "      <td>0.000000e+00</td>\n",
       "      <td>0</td>\n",
       "      <td>0</td>\n",
       "      <td>0</td>\n",
       "      <td>0</td>\n",
       "      <td>0</td>\n",
       "      <td>0</td>\n",
       "      <td>25.6</td>\n",
       "      <td>China</td>\n",
       "      <td>89,473.25</td>\n",
       "      <td>95,199.40</td>\n",
       "      <td>106.4</td>\n",
       "      <td>63,579.45</td>\n",
       "      <td>67,648.44</td>\n",
       "      <td>NaN</td>\n",
       "      <td>27,272.31</td>\n",
       "      <td>19,379.63</td>\n",
       "      <td>19.191</td>\n",
       "      <td>3.491</td>\n",
       "      <td>42.674</td>\n",
       "      <td>43.9</td>\n",
       "      <td>125.931</td>\n",
       "      <td>123.888</td>\n",
       "      <td>NaN</td>\n",
       "      <td>3.877</td>\n",
       "      <td>3.6</td>\n",
       "      <td>2.689</td>\n",
       "      <td>3</td>\n",
       "      <td>4.02</td>\n",
       "      <td>NaN</td>\n",
       "      <td>1,407.27</td>\n",
       "      <td>26,023.24</td>\n",
       "      <td>29,245.77</td>\n",
       "      <td>-3,222.53</td>\n",
       "      <td>-3,233.26</td>\n",
       "      <td>-2,116.07</td>\n",
       "      <td>NaN</td>\n",
       "      <td>51,791.90</td>\n",
       "      <td>95,199.40</td>\n",
       "      <td>170.037</td>\n",
       "      <td>76.7</td>\n",
       "      <td>1,439,323,776</td>\n",
       "      <td>153.0</td>\n",
       "      <td>38.0</td>\n",
       "      <td>61.0</td>\n",
       "      <td>NaN</td>\n",
       "      <td>1/26/2020</td>\n",
       "      <td>4.2</td>\n",
       "      <td>24.7</td>\n",
       "      <td>1.15</td>\n",
       "      <td>1.17</td>\n",
       "      <td>1.14</td>\n",
       "      <td>1.04</td>\n",
       "      <td>1.02</td>\n",
       "      <td>0.92</td>\n",
       "      <td>1.06</td>\n",
       "      <td>63.1</td>\n",
       "      <td>56.35</td>\n",
       "      <td>70.52</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>4983</th>\n",
       "      <td>4373.0</td>\n",
       "      <td>Anhui</td>\n",
       "      <td>China</td>\n",
       "      <td>31.8257</td>\n",
       "      <td>117.2264</td>\n",
       "      <td>2020-01-23</td>\n",
       "      <td>9.0</td>\n",
       "      <td>0.0</td>\n",
       "      <td>NaN</td>\n",
       "      <td>China/Anhui</td>\n",
       "      <td>23</td>\n",
       "      <td>8</td>\n",
       "      <td>0</td>\n",
       "      <td>1.000000e+00</td>\n",
       "      <td>0.000000e+00</td>\n",
       "      <td>0.000000e+00</td>\n",
       "      <td>0.000000e+00</td>\n",
       "      <td>0.000000e+00</td>\n",
       "      <td>0.000000e+00</td>\n",
       "      <td>0.000000e+00</td>\n",
       "      <td>0.000000e+00</td>\n",
       "      <td>1</td>\n",
       "      <td>0</td>\n",
       "      <td>0</td>\n",
       "      <td>0</td>\n",
       "      <td>0</td>\n",
       "      <td>0</td>\n",
       "      <td>25.6</td>\n",
       "      <td>China</td>\n",
       "      <td>89,473.25</td>\n",
       "      <td>95,199.40</td>\n",
       "      <td>106.4</td>\n",
       "      <td>63,579.45</td>\n",
       "      <td>67,648.44</td>\n",
       "      <td>NaN</td>\n",
       "      <td>27,272.31</td>\n",
       "      <td>19,379.63</td>\n",
       "      <td>19.191</td>\n",
       "      <td>3.491</td>\n",
       "      <td>42.674</td>\n",
       "      <td>43.9</td>\n",
       "      <td>125.931</td>\n",
       "      <td>123.888</td>\n",
       "      <td>NaN</td>\n",
       "      <td>3.877</td>\n",
       "      <td>3.6</td>\n",
       "      <td>2.689</td>\n",
       "      <td>3</td>\n",
       "      <td>4.02</td>\n",
       "      <td>NaN</td>\n",
       "      <td>1,407.27</td>\n",
       "      <td>26,023.24</td>\n",
       "      <td>29,245.77</td>\n",
       "      <td>-3,222.53</td>\n",
       "      <td>-3,233.26</td>\n",
       "      <td>-2,116.07</td>\n",
       "      <td>NaN</td>\n",
       "      <td>51,791.90</td>\n",
       "      <td>95,199.40</td>\n",
       "      <td>170.037</td>\n",
       "      <td>76.7</td>\n",
       "      <td>1,439,323,776</td>\n",
       "      <td>153.0</td>\n",
       "      <td>38.0</td>\n",
       "      <td>61.0</td>\n",
       "      <td>NaN</td>\n",
       "      <td>1/26/2020</td>\n",
       "      <td>4.2</td>\n",
       "      <td>24.7</td>\n",
       "      <td>1.15</td>\n",
       "      <td>1.17</td>\n",
       "      <td>1.14</td>\n",
       "      <td>1.04</td>\n",
       "      <td>1.02</td>\n",
       "      <td>0.92</td>\n",
       "      <td>1.06</td>\n",
       "      <td>63.1</td>\n",
       "      <td>56.35</td>\n",
       "      <td>70.52</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>4984</th>\n",
       "      <td>4374.0</td>\n",
       "      <td>Anhui</td>\n",
       "      <td>China</td>\n",
       "      <td>31.8257</td>\n",
       "      <td>117.2264</td>\n",
       "      <td>2020-01-24</td>\n",
       "      <td>15.0</td>\n",
       "      <td>0.0</td>\n",
       "      <td>NaN</td>\n",
       "      <td>China/Anhui</td>\n",
       "      <td>24</td>\n",
       "      <td>6</td>\n",
       "      <td>0</td>\n",
       "      <td>8.000000e+00</td>\n",
       "      <td>0.000000e+00</td>\n",
       "      <td>0.000000e+00</td>\n",
       "      <td>0.000000e+00</td>\n",
       "      <td>0.000000e+00</td>\n",
       "      <td>0.000000e+00</td>\n",
       "      <td>0.000000e+00</td>\n",
       "      <td>0.000000e+00</td>\n",
       "      <td>2</td>\n",
       "      <td>0</td>\n",
       "      <td>0</td>\n",
       "      <td>0</td>\n",
       "      <td>0</td>\n",
       "      <td>0</td>\n",
       "      <td>25.6</td>\n",
       "      <td>China</td>\n",
       "      <td>89,473.25</td>\n",
       "      <td>95,199.40</td>\n",
       "      <td>106.4</td>\n",
       "      <td>63,579.45</td>\n",
       "      <td>67,648.44</td>\n",
       "      <td>NaN</td>\n",
       "      <td>27,272.31</td>\n",
       "      <td>19,379.63</td>\n",
       "      <td>19.191</td>\n",
       "      <td>3.491</td>\n",
       "      <td>42.674</td>\n",
       "      <td>43.9</td>\n",
       "      <td>125.931</td>\n",
       "      <td>123.888</td>\n",
       "      <td>NaN</td>\n",
       "      <td>3.877</td>\n",
       "      <td>3.6</td>\n",
       "      <td>2.689</td>\n",
       "      <td>3</td>\n",
       "      <td>4.02</td>\n",
       "      <td>NaN</td>\n",
       "      <td>1,407.27</td>\n",
       "      <td>26,023.24</td>\n",
       "      <td>29,245.77</td>\n",
       "      <td>-3,222.53</td>\n",
       "      <td>-3,233.26</td>\n",
       "      <td>-2,116.07</td>\n",
       "      <td>NaN</td>\n",
       "      <td>51,791.90</td>\n",
       "      <td>95,199.40</td>\n",
       "      <td>170.037</td>\n",
       "      <td>76.7</td>\n",
       "      <td>1,439,323,776</td>\n",
       "      <td>153.0</td>\n",
       "      <td>38.0</td>\n",
       "      <td>61.0</td>\n",
       "      <td>NaN</td>\n",
       "      <td>1/26/2020</td>\n",
       "      <td>4.2</td>\n",
       "      <td>24.7</td>\n",
       "      <td>1.15</td>\n",
       "      <td>1.17</td>\n",
       "      <td>1.14</td>\n",
       "      <td>1.04</td>\n",
       "      <td>1.02</td>\n",
       "      <td>0.92</td>\n",
       "      <td>1.06</td>\n",
       "      <td>63.1</td>\n",
       "      <td>56.35</td>\n",
       "      <td>70.52</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>4985</th>\n",
       "      <td>4375.0</td>\n",
       "      <td>Anhui</td>\n",
       "      <td>China</td>\n",
       "      <td>31.8257</td>\n",
       "      <td>117.2264</td>\n",
       "      <td>2020-01-25</td>\n",
       "      <td>39.0</td>\n",
       "      <td>0.0</td>\n",
       "      <td>NaN</td>\n",
       "      <td>China/Anhui</td>\n",
       "      <td>25</td>\n",
       "      <td>24</td>\n",
       "      <td>0</td>\n",
       "      <td>6.000000e+00</td>\n",
       "      <td>0.000000e+00</td>\n",
       "      <td>0.000000e+00</td>\n",
       "      <td>0.000000e+00</td>\n",
       "      <td>0.000000e+00</td>\n",
       "      <td>0.000000e+00</td>\n",
       "      <td>0.000000e+00</td>\n",
       "      <td>0.000000e+00</td>\n",
       "      <td>3</td>\n",
       "      <td>1</td>\n",
       "      <td>0</td>\n",
       "      <td>0</td>\n",
       "      <td>0</td>\n",
       "      <td>0</td>\n",
       "      <td>25.6</td>\n",
       "      <td>China</td>\n",
       "      <td>89,473.25</td>\n",
       "      <td>95,199.40</td>\n",
       "      <td>106.4</td>\n",
       "      <td>63,579.45</td>\n",
       "      <td>67,648.44</td>\n",
       "      <td>NaN</td>\n",
       "      <td>27,272.31</td>\n",
       "      <td>19,379.63</td>\n",
       "      <td>19.191</td>\n",
       "      <td>3.491</td>\n",
       "      <td>42.674</td>\n",
       "      <td>43.9</td>\n",
       "      <td>125.931</td>\n",
       "      <td>123.888</td>\n",
       "      <td>NaN</td>\n",
       "      <td>3.877</td>\n",
       "      <td>3.6</td>\n",
       "      <td>2.689</td>\n",
       "      <td>3</td>\n",
       "      <td>4.02</td>\n",
       "      <td>NaN</td>\n",
       "      <td>1,407.27</td>\n",
       "      <td>26,023.24</td>\n",
       "      <td>29,245.77</td>\n",
       "      <td>-3,222.53</td>\n",
       "      <td>-3,233.26</td>\n",
       "      <td>-2,116.07</td>\n",
       "      <td>NaN</td>\n",
       "      <td>51,791.90</td>\n",
       "      <td>95,199.40</td>\n",
       "      <td>170.037</td>\n",
       "      <td>76.7</td>\n",
       "      <td>1,439,323,776</td>\n",
       "      <td>153.0</td>\n",
       "      <td>38.0</td>\n",
       "      <td>61.0</td>\n",
       "      <td>NaN</td>\n",
       "      <td>1/26/2020</td>\n",
       "      <td>4.2</td>\n",
       "      <td>24.7</td>\n",
       "      <td>1.15</td>\n",
       "      <td>1.17</td>\n",
       "      <td>1.14</td>\n",
       "      <td>1.04</td>\n",
       "      <td>1.02</td>\n",
       "      <td>0.92</td>\n",
       "      <td>1.06</td>\n",
       "      <td>63.1</td>\n",
       "      <td>56.35</td>\n",
       "      <td>70.52</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>4986</th>\n",
       "      <td>4376.0</td>\n",
       "      <td>Anhui</td>\n",
       "      <td>China</td>\n",
       "      <td>31.8257</td>\n",
       "      <td>117.2264</td>\n",
       "      <td>2020-01-26</td>\n",
       "      <td>60.0</td>\n",
       "      <td>0.0</td>\n",
       "      <td>NaN</td>\n",
       "      <td>China/Anhui</td>\n",
       "      <td>26</td>\n",
       "      <td>21</td>\n",
       "      <td>0</td>\n",
       "      <td>2.400000e+01</td>\n",
       "      <td>0.000000e+00</td>\n",
       "      <td>0.000000e+00</td>\n",
       "      <td>0.000000e+00</td>\n",
       "      <td>0.000000e+00</td>\n",
       "      <td>0.000000e+00</td>\n",
       "      <td>0.000000e+00</td>\n",
       "      <td>0.000000e+00</td>\n",
       "      <td>4</td>\n",
       "      <td>2</td>\n",
       "      <td>0</td>\n",
       "      <td>0</td>\n",
       "      <td>0</td>\n",
       "      <td>0</td>\n",
       "      <td>25.6</td>\n",
       "      <td>China</td>\n",
       "      <td>89,473.25</td>\n",
       "      <td>95,199.40</td>\n",
       "      <td>106.4</td>\n",
       "      <td>63,579.45</td>\n",
       "      <td>67,648.44</td>\n",
       "      <td>NaN</td>\n",
       "      <td>27,272.31</td>\n",
       "      <td>19,379.63</td>\n",
       "      <td>19.191</td>\n",
       "      <td>3.491</td>\n",
       "      <td>42.674</td>\n",
       "      <td>43.9</td>\n",
       "      <td>125.931</td>\n",
       "      <td>123.888</td>\n",
       "      <td>NaN</td>\n",
       "      <td>3.877</td>\n",
       "      <td>3.6</td>\n",
       "      <td>2.689</td>\n",
       "      <td>3</td>\n",
       "      <td>4.02</td>\n",
       "      <td>NaN</td>\n",
       "      <td>1,407.27</td>\n",
       "      <td>26,023.24</td>\n",
       "      <td>29,245.77</td>\n",
       "      <td>-3,222.53</td>\n",
       "      <td>-3,233.26</td>\n",
       "      <td>-2,116.07</td>\n",
       "      <td>NaN</td>\n",
       "      <td>51,791.90</td>\n",
       "      <td>95,199.40</td>\n",
       "      <td>170.037</td>\n",
       "      <td>76.7</td>\n",
       "      <td>1,439,323,776</td>\n",
       "      <td>153.0</td>\n",
       "      <td>38.0</td>\n",
       "      <td>61.0</td>\n",
       "      <td>NaN</td>\n",
       "      <td>1/26/2020</td>\n",
       "      <td>4.2</td>\n",
       "      <td>24.7</td>\n",
       "      <td>1.15</td>\n",
       "      <td>1.17</td>\n",
       "      <td>1.14</td>\n",
       "      <td>1.04</td>\n",
       "      <td>1.02</td>\n",
       "      <td>0.92</td>\n",
       "      <td>1.06</td>\n",
       "      <td>63.1</td>\n",
       "      <td>56.35</td>\n",
       "      <td>70.52</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>...</th>\n",
       "      <td>...</td>\n",
       "      <td>...</td>\n",
       "      <td>...</td>\n",
       "      <td>...</td>\n",
       "      <td>...</td>\n",
       "      <td>...</td>\n",
       "      <td>...</td>\n",
       "      <td>...</td>\n",
       "      <td>...</td>\n",
       "      <td>...</td>\n",
       "      <td>...</td>\n",
       "      <td>...</td>\n",
       "      <td>...</td>\n",
       "      <td>...</td>\n",
       "      <td>...</td>\n",
       "      <td>...</td>\n",
       "      <td>...</td>\n",
       "      <td>...</td>\n",
       "      <td>...</td>\n",
       "      <td>...</td>\n",
       "      <td>...</td>\n",
       "      <td>...</td>\n",
       "      <td>...</td>\n",
       "      <td>...</td>\n",
       "      <td>...</td>\n",
       "      <td>...</td>\n",
       "      <td>...</td>\n",
       "      <td>...</td>\n",
       "      <td>...</td>\n",
       "      <td>...</td>\n",
       "      <td>...</td>\n",
       "      <td>...</td>\n",
       "      <td>...</td>\n",
       "      <td>...</td>\n",
       "      <td>...</td>\n",
       "      <td>...</td>\n",
       "      <td>...</td>\n",
       "      <td>...</td>\n",
       "      <td>...</td>\n",
       "      <td>...</td>\n",
       "      <td>...</td>\n",
       "      <td>...</td>\n",
       "      <td>...</td>\n",
       "      <td>...</td>\n",
       "      <td>...</td>\n",
       "      <td>...</td>\n",
       "      <td>...</td>\n",
       "      <td>...</td>\n",
       "      <td>...</td>\n",
       "      <td>...</td>\n",
       "      <td>...</td>\n",
       "      <td>...</td>\n",
       "      <td>...</td>\n",
       "      <td>...</td>\n",
       "      <td>...</td>\n",
       "      <td>...</td>\n",
       "      <td>...</td>\n",
       "      <td>...</td>\n",
       "      <td>...</td>\n",
       "      <td>...</td>\n",
       "      <td>...</td>\n",
       "      <td>...</td>\n",
       "      <td>...</td>\n",
       "      <td>...</td>\n",
       "      <td>...</td>\n",
       "      <td>...</td>\n",
       "      <td>...</td>\n",
       "      <td>...</td>\n",
       "      <td>...</td>\n",
       "      <td>...</td>\n",
       "      <td>...</td>\n",
       "      <td>...</td>\n",
       "      <td>...</td>\n",
       "      <td>...</td>\n",
       "      <td>...</td>\n",
       "      <td>...</td>\n",
       "      <td>...</td>\n",
       "      <td>...</td>\n",
       "      <td>...</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>8475</th>\n",
       "      <td>NaN</td>\n",
       "      <td>Zhejiang</td>\n",
       "      <td>China</td>\n",
       "      <td>29.1832</td>\n",
       "      <td>120.0934</td>\n",
       "      <td>2020-04-19</td>\n",
       "      <td>NaN</td>\n",
       "      <td>NaN</td>\n",
       "      <td>3436.0</td>\n",
       "      <td>China/Zhejiang</td>\n",
       "      <td>110</td>\n",
       "      <td>-9223372036854775808</td>\n",
       "      <td>-9223372036854775808</td>\n",
       "      <td>-9.223372e+18</td>\n",
       "      <td>-9.223372e+18</td>\n",
       "      <td>-9.223372e+18</td>\n",
       "      <td>-9.223372e+18</td>\n",
       "      <td>-9.223372e+18</td>\n",
       "      <td>-9.223372e+18</td>\n",
       "      <td>-9.223372e+18</td>\n",
       "      <td>-9.223372e+18</td>\n",
       "      <td>88</td>\n",
       "      <td>88</td>\n",
       "      <td>84</td>\n",
       "      <td>59</td>\n",
       "      <td>25</td>\n",
       "      <td>25</td>\n",
       "      <td>25.6</td>\n",
       "      <td>China</td>\n",
       "      <td>89,473.25</td>\n",
       "      <td>95,199.40</td>\n",
       "      <td>106.4</td>\n",
       "      <td>63,579.45</td>\n",
       "      <td>67,648.44</td>\n",
       "      <td>NaN</td>\n",
       "      <td>27,272.31</td>\n",
       "      <td>19,379.63</td>\n",
       "      <td>19.191</td>\n",
       "      <td>3.491</td>\n",
       "      <td>42.674</td>\n",
       "      <td>43.9</td>\n",
       "      <td>125.931</td>\n",
       "      <td>123.888</td>\n",
       "      <td>NaN</td>\n",
       "      <td>3.877</td>\n",
       "      <td>3.6</td>\n",
       "      <td>2.689</td>\n",
       "      <td>3</td>\n",
       "      <td>4.02</td>\n",
       "      <td>NaN</td>\n",
       "      <td>1,407.27</td>\n",
       "      <td>26,023.24</td>\n",
       "      <td>29,245.77</td>\n",
       "      <td>-3,222.53</td>\n",
       "      <td>-3,233.26</td>\n",
       "      <td>-2,116.07</td>\n",
       "      <td>NaN</td>\n",
       "      <td>51,791.90</td>\n",
       "      <td>95,199.40</td>\n",
       "      <td>170.037</td>\n",
       "      <td>76.7</td>\n",
       "      <td>1,439,323,776</td>\n",
       "      <td>153.0</td>\n",
       "      <td>38.0</td>\n",
       "      <td>61.0</td>\n",
       "      <td>NaN</td>\n",
       "      <td>1/26/2020</td>\n",
       "      <td>4.2</td>\n",
       "      <td>24.7</td>\n",
       "      <td>1.15</td>\n",
       "      <td>1.17</td>\n",
       "      <td>1.14</td>\n",
       "      <td>1.04</td>\n",
       "      <td>1.02</td>\n",
       "      <td>0.92</td>\n",
       "      <td>1.06</td>\n",
       "      <td>63.1</td>\n",
       "      <td>56.35</td>\n",
       "      <td>70.52</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>8476</th>\n",
       "      <td>NaN</td>\n",
       "      <td>Zhejiang</td>\n",
       "      <td>China</td>\n",
       "      <td>29.1832</td>\n",
       "      <td>120.0934</td>\n",
       "      <td>2020-04-20</td>\n",
       "      <td>NaN</td>\n",
       "      <td>NaN</td>\n",
       "      <td>3437.0</td>\n",
       "      <td>China/Zhejiang</td>\n",
       "      <td>111</td>\n",
       "      <td>-9223372036854775808</td>\n",
       "      <td>-9223372036854775808</td>\n",
       "      <td>-9.223372e+18</td>\n",
       "      <td>-9.223372e+18</td>\n",
       "      <td>-9.223372e+18</td>\n",
       "      <td>-9.223372e+18</td>\n",
       "      <td>-9.223372e+18</td>\n",
       "      <td>-9.223372e+18</td>\n",
       "      <td>-9.223372e+18</td>\n",
       "      <td>-9.223372e+18</td>\n",
       "      <td>89</td>\n",
       "      <td>89</td>\n",
       "      <td>85</td>\n",
       "      <td>60</td>\n",
       "      <td>26</td>\n",
       "      <td>26</td>\n",
       "      <td>25.6</td>\n",
       "      <td>China</td>\n",
       "      <td>89,473.25</td>\n",
       "      <td>95,199.40</td>\n",
       "      <td>106.4</td>\n",
       "      <td>63,579.45</td>\n",
       "      <td>67,648.44</td>\n",
       "      <td>NaN</td>\n",
       "      <td>27,272.31</td>\n",
       "      <td>19,379.63</td>\n",
       "      <td>19.191</td>\n",
       "      <td>3.491</td>\n",
       "      <td>42.674</td>\n",
       "      <td>43.9</td>\n",
       "      <td>125.931</td>\n",
       "      <td>123.888</td>\n",
       "      <td>NaN</td>\n",
       "      <td>3.877</td>\n",
       "      <td>3.6</td>\n",
       "      <td>2.689</td>\n",
       "      <td>3</td>\n",
       "      <td>4.02</td>\n",
       "      <td>NaN</td>\n",
       "      <td>1,407.27</td>\n",
       "      <td>26,023.24</td>\n",
       "      <td>29,245.77</td>\n",
       "      <td>-3,222.53</td>\n",
       "      <td>-3,233.26</td>\n",
       "      <td>-2,116.07</td>\n",
       "      <td>NaN</td>\n",
       "      <td>51,791.90</td>\n",
       "      <td>95,199.40</td>\n",
       "      <td>170.037</td>\n",
       "      <td>76.7</td>\n",
       "      <td>1,439,323,776</td>\n",
       "      <td>153.0</td>\n",
       "      <td>38.0</td>\n",
       "      <td>61.0</td>\n",
       "      <td>NaN</td>\n",
       "      <td>1/26/2020</td>\n",
       "      <td>4.2</td>\n",
       "      <td>24.7</td>\n",
       "      <td>1.15</td>\n",
       "      <td>1.17</td>\n",
       "      <td>1.14</td>\n",
       "      <td>1.04</td>\n",
       "      <td>1.02</td>\n",
       "      <td>0.92</td>\n",
       "      <td>1.06</td>\n",
       "      <td>63.1</td>\n",
       "      <td>56.35</td>\n",
       "      <td>70.52</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>8477</th>\n",
       "      <td>NaN</td>\n",
       "      <td>Zhejiang</td>\n",
       "      <td>China</td>\n",
       "      <td>29.1832</td>\n",
       "      <td>120.0934</td>\n",
       "      <td>2020-04-21</td>\n",
       "      <td>NaN</td>\n",
       "      <td>NaN</td>\n",
       "      <td>3438.0</td>\n",
       "      <td>China/Zhejiang</td>\n",
       "      <td>112</td>\n",
       "      <td>-9223372036854775808</td>\n",
       "      <td>-9223372036854775808</td>\n",
       "      <td>-9.223372e+18</td>\n",
       "      <td>-9.223372e+18</td>\n",
       "      <td>-9.223372e+18</td>\n",
       "      <td>-9.223372e+18</td>\n",
       "      <td>-9.223372e+18</td>\n",
       "      <td>-9.223372e+18</td>\n",
       "      <td>-9.223372e+18</td>\n",
       "      <td>-9.223372e+18</td>\n",
       "      <td>90</td>\n",
       "      <td>90</td>\n",
       "      <td>86</td>\n",
       "      <td>61</td>\n",
       "      <td>27</td>\n",
       "      <td>27</td>\n",
       "      <td>25.6</td>\n",
       "      <td>China</td>\n",
       "      <td>89,473.25</td>\n",
       "      <td>95,199.40</td>\n",
       "      <td>106.4</td>\n",
       "      <td>63,579.45</td>\n",
       "      <td>67,648.44</td>\n",
       "      <td>NaN</td>\n",
       "      <td>27,272.31</td>\n",
       "      <td>19,379.63</td>\n",
       "      <td>19.191</td>\n",
       "      <td>3.491</td>\n",
       "      <td>42.674</td>\n",
       "      <td>43.9</td>\n",
       "      <td>125.931</td>\n",
       "      <td>123.888</td>\n",
       "      <td>NaN</td>\n",
       "      <td>3.877</td>\n",
       "      <td>3.6</td>\n",
       "      <td>2.689</td>\n",
       "      <td>3</td>\n",
       "      <td>4.02</td>\n",
       "      <td>NaN</td>\n",
       "      <td>1,407.27</td>\n",
       "      <td>26,023.24</td>\n",
       "      <td>29,245.77</td>\n",
       "      <td>-3,222.53</td>\n",
       "      <td>-3,233.26</td>\n",
       "      <td>-2,116.07</td>\n",
       "      <td>NaN</td>\n",
       "      <td>51,791.90</td>\n",
       "      <td>95,199.40</td>\n",
       "      <td>170.037</td>\n",
       "      <td>76.7</td>\n",
       "      <td>1,439,323,776</td>\n",
       "      <td>153.0</td>\n",
       "      <td>38.0</td>\n",
       "      <td>61.0</td>\n",
       "      <td>NaN</td>\n",
       "      <td>1/26/2020</td>\n",
       "      <td>4.2</td>\n",
       "      <td>24.7</td>\n",
       "      <td>1.15</td>\n",
       "      <td>1.17</td>\n",
       "      <td>1.14</td>\n",
       "      <td>1.04</td>\n",
       "      <td>1.02</td>\n",
       "      <td>0.92</td>\n",
       "      <td>1.06</td>\n",
       "      <td>63.1</td>\n",
       "      <td>56.35</td>\n",
       "      <td>70.52</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>8478</th>\n",
       "      <td>NaN</td>\n",
       "      <td>Zhejiang</td>\n",
       "      <td>China</td>\n",
       "      <td>29.1832</td>\n",
       "      <td>120.0934</td>\n",
       "      <td>2020-04-22</td>\n",
       "      <td>NaN</td>\n",
       "      <td>NaN</td>\n",
       "      <td>3439.0</td>\n",
       "      <td>China/Zhejiang</td>\n",
       "      <td>113</td>\n",
       "      <td>-9223372036854775808</td>\n",
       "      <td>-9223372036854775808</td>\n",
       "      <td>-9.223372e+18</td>\n",
       "      <td>-9.223372e+18</td>\n",
       "      <td>-9.223372e+18</td>\n",
       "      <td>-9.223372e+18</td>\n",
       "      <td>-9.223372e+18</td>\n",
       "      <td>-9.223372e+18</td>\n",
       "      <td>-9.223372e+18</td>\n",
       "      <td>-9.223372e+18</td>\n",
       "      <td>91</td>\n",
       "      <td>91</td>\n",
       "      <td>87</td>\n",
       "      <td>62</td>\n",
       "      <td>28</td>\n",
       "      <td>28</td>\n",
       "      <td>25.6</td>\n",
       "      <td>China</td>\n",
       "      <td>89,473.25</td>\n",
       "      <td>95,199.40</td>\n",
       "      <td>106.4</td>\n",
       "      <td>63,579.45</td>\n",
       "      <td>67,648.44</td>\n",
       "      <td>NaN</td>\n",
       "      <td>27,272.31</td>\n",
       "      <td>19,379.63</td>\n",
       "      <td>19.191</td>\n",
       "      <td>3.491</td>\n",
       "      <td>42.674</td>\n",
       "      <td>43.9</td>\n",
       "      <td>125.931</td>\n",
       "      <td>123.888</td>\n",
       "      <td>NaN</td>\n",
       "      <td>3.877</td>\n",
       "      <td>3.6</td>\n",
       "      <td>2.689</td>\n",
       "      <td>3</td>\n",
       "      <td>4.02</td>\n",
       "      <td>NaN</td>\n",
       "      <td>1,407.27</td>\n",
       "      <td>26,023.24</td>\n",
       "      <td>29,245.77</td>\n",
       "      <td>-3,222.53</td>\n",
       "      <td>-3,233.26</td>\n",
       "      <td>-2,116.07</td>\n",
       "      <td>NaN</td>\n",
       "      <td>51,791.90</td>\n",
       "      <td>95,199.40</td>\n",
       "      <td>170.037</td>\n",
       "      <td>76.7</td>\n",
       "      <td>1,439,323,776</td>\n",
       "      <td>153.0</td>\n",
       "      <td>38.0</td>\n",
       "      <td>61.0</td>\n",
       "      <td>NaN</td>\n",
       "      <td>1/26/2020</td>\n",
       "      <td>4.2</td>\n",
       "      <td>24.7</td>\n",
       "      <td>1.15</td>\n",
       "      <td>1.17</td>\n",
       "      <td>1.14</td>\n",
       "      <td>1.04</td>\n",
       "      <td>1.02</td>\n",
       "      <td>0.92</td>\n",
       "      <td>1.06</td>\n",
       "      <td>63.1</td>\n",
       "      <td>56.35</td>\n",
       "      <td>70.52</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>8479</th>\n",
       "      <td>NaN</td>\n",
       "      <td>Zhejiang</td>\n",
       "      <td>China</td>\n",
       "      <td>29.1832</td>\n",
       "      <td>120.0934</td>\n",
       "      <td>2020-04-23</td>\n",
       "      <td>NaN</td>\n",
       "      <td>NaN</td>\n",
       "      <td>3440.0</td>\n",
       "      <td>China/Zhejiang</td>\n",
       "      <td>114</td>\n",
       "      <td>-9223372036854775808</td>\n",
       "      <td>-9223372036854775808</td>\n",
       "      <td>-9.223372e+18</td>\n",
       "      <td>-9.223372e+18</td>\n",
       "      <td>-9.223372e+18</td>\n",
       "      <td>-9.223372e+18</td>\n",
       "      <td>-9.223372e+18</td>\n",
       "      <td>-9.223372e+18</td>\n",
       "      <td>-9.223372e+18</td>\n",
       "      <td>-9.223372e+18</td>\n",
       "      <td>92</td>\n",
       "      <td>92</td>\n",
       "      <td>88</td>\n",
       "      <td>63</td>\n",
       "      <td>29</td>\n",
       "      <td>29</td>\n",
       "      <td>25.6</td>\n",
       "      <td>China</td>\n",
       "      <td>89,473.25</td>\n",
       "      <td>95,199.40</td>\n",
       "      <td>106.4</td>\n",
       "      <td>63,579.45</td>\n",
       "      <td>67,648.44</td>\n",
       "      <td>NaN</td>\n",
       "      <td>27,272.31</td>\n",
       "      <td>19,379.63</td>\n",
       "      <td>19.191</td>\n",
       "      <td>3.491</td>\n",
       "      <td>42.674</td>\n",
       "      <td>43.9</td>\n",
       "      <td>125.931</td>\n",
       "      <td>123.888</td>\n",
       "      <td>NaN</td>\n",
       "      <td>3.877</td>\n",
       "      <td>3.6</td>\n",
       "      <td>2.689</td>\n",
       "      <td>3</td>\n",
       "      <td>4.02</td>\n",
       "      <td>NaN</td>\n",
       "      <td>1,407.27</td>\n",
       "      <td>26,023.24</td>\n",
       "      <td>29,245.77</td>\n",
       "      <td>-3,222.53</td>\n",
       "      <td>-3,233.26</td>\n",
       "      <td>-2,116.07</td>\n",
       "      <td>NaN</td>\n",
       "      <td>51,791.90</td>\n",
       "      <td>95,199.40</td>\n",
       "      <td>170.037</td>\n",
       "      <td>76.7</td>\n",
       "      <td>1,439,323,776</td>\n",
       "      <td>153.0</td>\n",
       "      <td>38.0</td>\n",
       "      <td>61.0</td>\n",
       "      <td>NaN</td>\n",
       "      <td>1/26/2020</td>\n",
       "      <td>4.2</td>\n",
       "      <td>24.7</td>\n",
       "      <td>1.15</td>\n",
       "      <td>1.17</td>\n",
       "      <td>1.14</td>\n",
       "      <td>1.04</td>\n",
       "      <td>1.02</td>\n",
       "      <td>0.92</td>\n",
       "      <td>1.06</td>\n",
       "      <td>63.1</td>\n",
       "      <td>56.35</td>\n",
       "      <td>70.52</td>\n",
       "    </tr>\n",
       "  </tbody>\n",
       "</table>\n",
       "<p>3498 rows × 79 columns</p>\n",
       "</div>"
      ],
      "text/plain": [
       "          Id Province/State Country/Region      Lat      Long       Date  \\\n",
       "4982  4372.0          Anhui          China  31.8257  117.2264 2020-01-22   \n",
       "4983  4373.0          Anhui          China  31.8257  117.2264 2020-01-23   \n",
       "4984  4374.0          Anhui          China  31.8257  117.2264 2020-01-24   \n",
       "4985  4375.0          Anhui          China  31.8257  117.2264 2020-01-25   \n",
       "4986  4376.0          Anhui          China  31.8257  117.2264 2020-01-26   \n",
       "...      ...            ...            ...      ...       ...        ...   \n",
       "8475     NaN       Zhejiang          China  29.1832  120.0934 2020-04-19   \n",
       "8476     NaN       Zhejiang          China  29.1832  120.0934 2020-04-20   \n",
       "8477     NaN       Zhejiang          China  29.1832  120.0934 2020-04-21   \n",
       "8478     NaN       Zhejiang          China  29.1832  120.0934 2020-04-22   \n",
       "8479     NaN       Zhejiang          China  29.1832  120.0934 2020-04-23   \n",
       "\n",
       "      ConfirmedCases  Fatalities  ForecastId        place_id  day  \\\n",
       "4982             1.0         0.0         NaN     China/Anhui   22   \n",
       "4983             9.0         0.0         NaN     China/Anhui   23   \n",
       "4984            15.0         0.0         NaN     China/Anhui   24   \n",
       "4985            39.0         0.0         NaN     China/Anhui   25   \n",
       "4986            60.0         0.0         NaN     China/Anhui   26   \n",
       "...              ...         ...         ...             ...  ...   \n",
       "8475             NaN         NaN      3436.0  China/Zhejiang  110   \n",
       "8476             NaN         NaN      3437.0  China/Zhejiang  111   \n",
       "8477             NaN         NaN      3438.0  China/Zhejiang  112   \n",
       "8478             NaN         NaN      3439.0  China/Zhejiang  113   \n",
       "8479             NaN         NaN      3440.0  China/Zhejiang  114   \n",
       "\n",
       "                cases/day            fatal/day  cases/day-(1-1)  \\\n",
       "4982                    1                    0     0.000000e+00   \n",
       "4983                    8                    0     1.000000e+00   \n",
       "4984                    6                    0     8.000000e+00   \n",
       "4985                   24                    0     6.000000e+00   \n",
       "4986                   21                    0     2.400000e+01   \n",
       "...                   ...                  ...              ...   \n",
       "8475 -9223372036854775808 -9223372036854775808    -9.223372e+18   \n",
       "8476 -9223372036854775808 -9223372036854775808    -9.223372e+18   \n",
       "8477 -9223372036854775808 -9223372036854775808    -9.223372e+18   \n",
       "8478 -9223372036854775808 -9223372036854775808    -9.223372e+18   \n",
       "8479 -9223372036854775808 -9223372036854775808    -9.223372e+18   \n",
       "\n",
       "      cases/day-(1-7)  cases/day-(8-14)  cases/day-(15-21)  fatal/day-(1-1)  \\\n",
       "4982     0.000000e+00      0.000000e+00       0.000000e+00     0.000000e+00   \n",
       "4983     0.000000e+00      0.000000e+00       0.000000e+00     0.000000e+00   \n",
       "4984     0.000000e+00      0.000000e+00       0.000000e+00     0.000000e+00   \n",
       "4985     0.000000e+00      0.000000e+00       0.000000e+00     0.000000e+00   \n",
       "4986     0.000000e+00      0.000000e+00       0.000000e+00     0.000000e+00   \n",
       "...               ...               ...                ...              ...   \n",
       "8475    -9.223372e+18     -9.223372e+18      -9.223372e+18    -9.223372e+18   \n",
       "8476    -9.223372e+18     -9.223372e+18      -9.223372e+18    -9.223372e+18   \n",
       "8477    -9.223372e+18     -9.223372e+18      -9.223372e+18    -9.223372e+18   \n",
       "8478    -9.223372e+18     -9.223372e+18      -9.223372e+18    -9.223372e+18   \n",
       "8479    -9.223372e+18     -9.223372e+18      -9.223372e+18    -9.223372e+18   \n",
       "\n",
       "      fatal/day-(1-7)  fatal/day-(8-14)  fatal/day-(15-21)  days_since_1cases  \\\n",
       "4982     0.000000e+00      0.000000e+00       0.000000e+00                  0   \n",
       "4983     0.000000e+00      0.000000e+00       0.000000e+00                  1   \n",
       "4984     0.000000e+00      0.000000e+00       0.000000e+00                  2   \n",
       "4985     0.000000e+00      0.000000e+00       0.000000e+00                  3   \n",
       "4986     0.000000e+00      0.000000e+00       0.000000e+00                  4   \n",
       "...               ...               ...                ...                ...   \n",
       "8475    -9.223372e+18     -9.223372e+18      -9.223372e+18                 88   \n",
       "8476    -9.223372e+18     -9.223372e+18      -9.223372e+18                 89   \n",
       "8477    -9.223372e+18     -9.223372e+18      -9.223372e+18                 90   \n",
       "8478    -9.223372e+18     -9.223372e+18      -9.223372e+18                 91   \n",
       "8479    -9.223372e+18     -9.223372e+18      -9.223372e+18                 92   \n",
       "\n",
       "      days_since_10cases  days_since_100cases  days_since_1fatal  \\\n",
       "4982                   0                    0                  0   \n",
       "4983                   0                    0                  0   \n",
       "4984                   0                    0                  0   \n",
       "4985                   1                    0                  0   \n",
       "4986                   2                    0                  0   \n",
       "...                  ...                  ...                ...   \n",
       "8475                  88                   84                 59   \n",
       "8476                  89                   85                 60   \n",
       "8477                  90                   86                 61   \n",
       "8478                  91                   87                 62   \n",
       "8479                  92                   88                 63   \n",
       "\n",
       "      days_since_10fatal  days_since_100fatal  SmokingRate Country  \\\n",
       "4982                   0                    0         25.6   China   \n",
       "4983                   0                    0         25.6   China   \n",
       "4984                   0                    0         25.6   China   \n",
       "4985                   0                    0         25.6   China   \n",
       "4986                   0                    0         25.6   China   \n",
       "...                  ...                  ...          ...     ...   \n",
       "8475                  25                   25         25.6   China   \n",
       "8476                  26                   26         25.6   China   \n",
       "8477                  27                   27         25.6   China   \n",
       "8478                  28                   28         25.6   China   \n",
       "8479                  29                   29         25.6   China   \n",
       "\n",
       "     Gross_domestic_product__constant_prices  \\\n",
       "4982                               89,473.25   \n",
       "4983                               89,473.25   \n",
       "4984                               89,473.25   \n",
       "4985                               89,473.25   \n",
       "4986                               89,473.25   \n",
       "...                                      ...   \n",
       "8475                               89,473.25   \n",
       "8476                               89,473.25   \n",
       "8477                               89,473.25   \n",
       "8478                               89,473.25   \n",
       "8479                               89,473.25   \n",
       "\n",
       "     Gross_domestic_product__current_prices Gross_domestic_product__deflator  \\\n",
       "4982                              95,199.40                            106.4   \n",
       "4983                              95,199.40                            106.4   \n",
       "4984                              95,199.40                            106.4   \n",
       "4985                              95,199.40                            106.4   \n",
       "4986                              95,199.40                            106.4   \n",
       "...                                     ...                              ...   \n",
       "8475                              95,199.40                            106.4   \n",
       "8476                              95,199.40                            106.4   \n",
       "8477                              95,199.40                            106.4   \n",
       "8478                              95,199.40                            106.4   \n",
       "8479                              95,199.40                            106.4   \n",
       "\n",
       "     Gross_domestic_product_per_capita__constant_prices  \\\n",
       "4982                                          63,579.45   \n",
       "4983                                          63,579.45   \n",
       "4984                                          63,579.45   \n",
       "4985                                          63,579.45   \n",
       "4986                                          63,579.45   \n",
       "...                                                 ...   \n",
       "8475                                          63,579.45   \n",
       "8476                                          63,579.45   \n",
       "8477                                          63,579.45   \n",
       "8478                                          63,579.45   \n",
       "8479                                          63,579.45   \n",
       "\n",
       "     Gross_domestic_product_per_capita__current_prices  \\\n",
       "4982                                         67,648.44   \n",
       "4983                                         67,648.44   \n",
       "4984                                         67,648.44   \n",
       "4985                                         67,648.44   \n",
       "4986                                         67,648.44   \n",
       "...                                                ...   \n",
       "8475                                         67,648.44   \n",
       "8476                                         67,648.44   \n",
       "8477                                         67,648.44   \n",
       "8478                                         67,648.44   \n",
       "8479                                         67,648.44   \n",
       "\n",
       "     Output_gap_in_percent_of_potential_GDP  \\\n",
       "4982                                    NaN   \n",
       "4983                                    NaN   \n",
       "4984                                    NaN   \n",
       "4985                                    NaN   \n",
       "4986                                    NaN   \n",
       "...                                     ...   \n",
       "8475                                    NaN   \n",
       "8476                                    NaN   \n",
       "8477                                    NaN   \n",
       "8478                                    NaN   \n",
       "8479                                    NaN   \n",
       "\n",
       "     Gross_domestic_product_based_on_purchasing_power_parity__PPP__valuation_of_country_GDP  \\\n",
       "4982                                          27,272.31                                       \n",
       "4983                                          27,272.31                                       \n",
       "4984                                          27,272.31                                       \n",
       "4985                                          27,272.31                                       \n",
       "4986                                          27,272.31                                       \n",
       "...                                                 ...                                       \n",
       "8475                                          27,272.31                                       \n",
       "8476                                          27,272.31                                       \n",
       "8477                                          27,272.31                                       \n",
       "8478                                          27,272.31                                       \n",
       "8479                                          27,272.31                                       \n",
       "\n",
       "     Gross_domestic_product_based_on_purchasing_power_parity__PPP__per_capita_GDP  \\\n",
       "4982                                          19,379.63                             \n",
       "4983                                          19,379.63                             \n",
       "4984                                          19,379.63                             \n",
       "4985                                          19,379.63                             \n",
       "4986                                          19,379.63                             \n",
       "...                                                 ...                             \n",
       "8475                                          19,379.63                             \n",
       "8476                                          19,379.63                             \n",
       "8477                                          19,379.63                             \n",
       "8478                                          19,379.63                             \n",
       "8479                                          19,379.63                             \n",
       "\n",
       "     Gross_domestic_product_based_on_purchasing_power_parity__PPP__share_of_world_total  \\\n",
       "4982                                             19.191                                   \n",
       "4983                                             19.191                                   \n",
       "4984                                             19.191                                   \n",
       "4985                                             19.191                                   \n",
       "4986                                             19.191                                   \n",
       "...                                                 ...                                   \n",
       "8475                                             19.191                                   \n",
       "8476                                             19.191                                   \n",
       "8477                                             19.191                                   \n",
       "8478                                             19.191                                   \n",
       "8479                                             19.191                                   \n",
       "\n",
       "     Implied_PPP_conversion_rate Total_investment Gross_national_savings  \\\n",
       "4982                       3.491           42.674                   43.9   \n",
       "4983                       3.491           42.674                   43.9   \n",
       "4984                       3.491           42.674                   43.9   \n",
       "4985                       3.491           42.674                   43.9   \n",
       "4986                       3.491           42.674                   43.9   \n",
       "...                          ...              ...                    ...   \n",
       "8475                       3.491           42.674                   43.9   \n",
       "8476                       3.491           42.674                   43.9   \n",
       "8477                       3.491           42.674                   43.9   \n",
       "8478                       3.491           42.674                   43.9   \n",
       "8479                       3.491           42.674                   43.9   \n",
       "\n",
       "     Inflation__average_consumer_prices  \\\n",
       "4982                            125.931   \n",
       "4983                            125.931   \n",
       "4984                            125.931   \n",
       "4985                            125.931   \n",
       "4986                            125.931   \n",
       "...                                 ...   \n",
       "8475                            125.931   \n",
       "8476                            125.931   \n",
       "8477                            125.931   \n",
       "8478                            125.931   \n",
       "8479                            125.931   \n",
       "\n",
       "     Inflation__end_of_period_consumer_prices  \\\n",
       "4982                                  123.888   \n",
       "4983                                  123.888   \n",
       "4984                                  123.888   \n",
       "4985                                  123.888   \n",
       "4986                                  123.888   \n",
       "...                                       ...   \n",
       "8475                                  123.888   \n",
       "8476                                  123.888   \n",
       "8477                                  123.888   \n",
       "8478                                  123.888   \n",
       "8479                                  123.888   \n",
       "\n",
       "     Six_month_London_interbank_offered_rate__LIBOR_  \\\n",
       "4982                                             NaN   \n",
       "4983                                             NaN   \n",
       "4984                                             NaN   \n",
       "4985                                             NaN   \n",
       "4986                                             NaN   \n",
       "...                                              ...   \n",
       "8475                                             NaN   \n",
       "8476                                             NaN   \n",
       "8477                                             NaN   \n",
       "8478                                             NaN   \n",
       "8479                                             NaN   \n",
       "\n",
       "     Volume_of_imports_of_goods_and_services Volume_of_Imports_of_goods  \\\n",
       "4982                                   3.877                        3.6   \n",
       "4983                                   3.877                        3.6   \n",
       "4984                                   3.877                        3.6   \n",
       "4985                                   3.877                        3.6   \n",
       "4986                                   3.877                        3.6   \n",
       "...                                      ...                        ...   \n",
       "8475                                   3.877                        3.6   \n",
       "8476                                   3.877                        3.6   \n",
       "8477                                   3.877                        3.6   \n",
       "8478                                   3.877                        3.6   \n",
       "8479                                   3.877                        3.6   \n",
       "\n",
       "     Volume_of_exports_of_goods_and_services Volume_of_exports_of_goods  \\\n",
       "4982                                   2.689                          3   \n",
       "4983                                   2.689                          3   \n",
       "4984                                   2.689                          3   \n",
       "4985                                   2.689                          3   \n",
       "4986                                   2.689                          3   \n",
       "...                                      ...                        ...   \n",
       "8475                                   2.689                          3   \n",
       "8476                                   2.689                          3   \n",
       "8477                                   2.689                          3   \n",
       "8478                                   2.689                          3   \n",
       "8479                                   2.689                          3   \n",
       "\n",
       "     Unemployment_rate Employment Population General_government_revenue  \\\n",
       "4982              4.02        NaN   1,407.27                  26,023.24   \n",
       "4983              4.02        NaN   1,407.27                  26,023.24   \n",
       "4984              4.02        NaN   1,407.27                  26,023.24   \n",
       "4985              4.02        NaN   1,407.27                  26,023.24   \n",
       "4986              4.02        NaN   1,407.27                  26,023.24   \n",
       "...                ...        ...        ...                        ...   \n",
       "8475              4.02        NaN   1,407.27                  26,023.24   \n",
       "8476              4.02        NaN   1,407.27                  26,023.24   \n",
       "8477              4.02        NaN   1,407.27                  26,023.24   \n",
       "8478              4.02        NaN   1,407.27                  26,023.24   \n",
       "8479              4.02        NaN   1,407.27                  26,023.24   \n",
       "\n",
       "     General_government_total_expenditure  \\\n",
       "4982                            29,245.77   \n",
       "4983                            29,245.77   \n",
       "4984                            29,245.77   \n",
       "4985                            29,245.77   \n",
       "4986                            29,245.77   \n",
       "...                                   ...   \n",
       "8475                            29,245.77   \n",
       "8476                            29,245.77   \n",
       "8477                            29,245.77   \n",
       "8478                            29,245.77   \n",
       "8479                            29,245.77   \n",
       "\n",
       "     General_government_net_lending_borrowing  \\\n",
       "4982                                -3,222.53   \n",
       "4983                                -3,222.53   \n",
       "4984                                -3,222.53   \n",
       "4985                                -3,222.53   \n",
       "4986                                -3,222.53   \n",
       "...                                       ...   \n",
       "8475                                -3,222.53   \n",
       "8476                                -3,222.53   \n",
       "8477                                -3,222.53   \n",
       "8478                                -3,222.53   \n",
       "8479                                -3,222.53   \n",
       "\n",
       "     General_government_structural_balance  \\\n",
       "4982                             -3,233.26   \n",
       "4983                             -3,233.26   \n",
       "4984                             -3,233.26   \n",
       "4985                             -3,233.26   \n",
       "4986                             -3,233.26   \n",
       "...                                    ...   \n",
       "8475                             -3,233.26   \n",
       "8476                             -3,233.26   \n",
       "8477                             -3,233.26   \n",
       "8478                             -3,233.26   \n",
       "8479                             -3,233.26   \n",
       "\n",
       "     General_government_primary_net_lending_borrowing  \\\n",
       "4982                                        -2,116.07   \n",
       "4983                                        -2,116.07   \n",
       "4984                                        -2,116.07   \n",
       "4985                                        -2,116.07   \n",
       "4986                                        -2,116.07   \n",
       "...                                               ...   \n",
       "8475                                        -2,116.07   \n",
       "8476                                        -2,116.07   \n",
       "8477                                        -2,116.07   \n",
       "8478                                        -2,116.07   \n",
       "8479                                        -2,116.07   \n",
       "\n",
       "     General_government_net_debt General_government_gross_debt  \\\n",
       "4982                         NaN                     51,791.90   \n",
       "4983                         NaN                     51,791.90   \n",
       "4984                         NaN                     51,791.90   \n",
       "4985                         NaN                     51,791.90   \n",
       "4986                         NaN                     51,791.90   \n",
       "...                          ...                           ...   \n",
       "8475                         NaN                     51,791.90   \n",
       "8476                         NaN                     51,791.90   \n",
       "8477                         NaN                     51,791.90   \n",
       "8478                         NaN                     51,791.90   \n",
       "8479                         NaN                     51,791.90   \n",
       "\n",
       "     Gross_domestic_product_corresponding_to_fiscal_year__current_prices  \\\n",
       "4982                                          95,199.40                    \n",
       "4983                                          95,199.40                    \n",
       "4984                                          95,199.40                    \n",
       "4985                                          95,199.40                    \n",
       "4986                                          95,199.40                    \n",
       "...                                                 ...                    \n",
       "8475                                          95,199.40                    \n",
       "8476                                          95,199.40                    \n",
       "8477                                          95,199.40                    \n",
       "8478                                          95,199.40                    \n",
       "8479                                          95,199.40                    \n",
       "\n",
       "     Current_account_balance  LifeExpectancy            pop  density  \\\n",
       "4982                 170.037            76.7  1,439,323,776    153.0   \n",
       "4983                 170.037            76.7  1,439,323,776    153.0   \n",
       "4984                 170.037            76.7  1,439,323,776    153.0   \n",
       "4985                 170.037            76.7  1,439,323,776    153.0   \n",
       "4986                 170.037            76.7  1,439,323,776    153.0   \n",
       "...                      ...             ...            ...      ...   \n",
       "8475                 170.037            76.7  1,439,323,776    153.0   \n",
       "8476                 170.037            76.7  1,439,323,776    153.0   \n",
       "8477                 170.037            76.7  1,439,323,776    153.0   \n",
       "8478                 170.037            76.7  1,439,323,776    153.0   \n",
       "8479                 170.037            76.7  1,439,323,776    153.0   \n",
       "\n",
       "      medianage  urbanpop quarantine    schools  hospibed  smokers  sex0  \\\n",
       "4982       38.0      61.0        NaN  1/26/2020       4.2     24.7  1.15   \n",
       "4983       38.0      61.0        NaN  1/26/2020       4.2     24.7  1.15   \n",
       "4984       38.0      61.0        NaN  1/26/2020       4.2     24.7  1.15   \n",
       "4985       38.0      61.0        NaN  1/26/2020       4.2     24.7  1.15   \n",
       "4986       38.0      61.0        NaN  1/26/2020       4.2     24.7  1.15   \n",
       "...         ...       ...        ...        ...       ...      ...   ...   \n",
       "8475       38.0      61.0        NaN  1/26/2020       4.2     24.7  1.15   \n",
       "8476       38.0      61.0        NaN  1/26/2020       4.2     24.7  1.15   \n",
       "8477       38.0      61.0        NaN  1/26/2020       4.2     24.7  1.15   \n",
       "8478       38.0      61.0        NaN  1/26/2020       4.2     24.7  1.15   \n",
       "8479       38.0      61.0        NaN  1/26/2020       4.2     24.7  1.15   \n",
       "\n",
       "      sex14  sex25  sex54  sex64  sex65plus  sexratio  lung  femalelung  \\\n",
       "4982   1.17   1.14   1.04   1.02       0.92      1.06  63.1       56.35   \n",
       "4983   1.17   1.14   1.04   1.02       0.92      1.06  63.1       56.35   \n",
       "4984   1.17   1.14   1.04   1.02       0.92      1.06  63.1       56.35   \n",
       "4985   1.17   1.14   1.04   1.02       0.92      1.06  63.1       56.35   \n",
       "4986   1.17   1.14   1.04   1.02       0.92      1.06  63.1       56.35   \n",
       "...     ...    ...    ...    ...        ...       ...   ...         ...   \n",
       "8475   1.17   1.14   1.04   1.02       0.92      1.06  63.1       56.35   \n",
       "8476   1.17   1.14   1.04   1.02       0.92      1.06  63.1       56.35   \n",
       "8477   1.17   1.14   1.04   1.02       0.92      1.06  63.1       56.35   \n",
       "8478   1.17   1.14   1.04   1.02       0.92      1.06  63.1       56.35   \n",
       "8479   1.17   1.14   1.04   1.02       0.92      1.06  63.1       56.35   \n",
       "\n",
       "      malelung  \n",
       "4982     70.52  \n",
       "4983     70.52  \n",
       "4984     70.52  \n",
       "4985     70.52  \n",
       "4986     70.52  \n",
       "...        ...  \n",
       "8475     70.52  \n",
       "8476     70.52  \n",
       "8477     70.52  \n",
       "8478     70.52  \n",
       "8479     70.52  \n",
       "\n",
       "[3498 rows x 79 columns]"
      ]
     },
     "execution_count": 82,
     "metadata": {},
     "output_type": "execute_result"
    }
   ],
   "source": [
    "df_traintest7=pd.merge(df_traintest6,df_country.drop([\"country\",\"testpop\",\"tests\"],axis=1),on=[\"Country/Region\"],how=\"left\")\n",
    "print(df_traintest7.shape)\n",
    "df_traintest7.head()\n",
    "df_traintest7[df_traintest7[\"Country/Region\"]==\"China\"]"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 83,
   "metadata": {},
   "outputs": [
    {
     "data": {
      "text/html": [
       "<div>\n",
       "<style scoped>\n",
       "    .dataframe tbody tr th:only-of-type {\n",
       "        vertical-align: middle;\n",
       "    }\n",
       "\n",
       "    .dataframe tbody tr th {\n",
       "        vertical-align: top;\n",
       "    }\n",
       "\n",
       "    .dataframe thead th {\n",
       "        text-align: right;\n",
       "    }\n",
       "</style>\n",
       "<table border=\"1\" class=\"dataframe\">\n",
       "  <thead>\n",
       "    <tr style=\"text-align: right;\">\n",
       "      <th></th>\n",
       "      <th>Id</th>\n",
       "      <th>Province/State</th>\n",
       "      <th>Country/Region</th>\n",
       "      <th>Lat</th>\n",
       "      <th>Long</th>\n",
       "      <th>Date</th>\n",
       "      <th>ConfirmedCases</th>\n",
       "      <th>Fatalities</th>\n",
       "      <th>ForecastId</th>\n",
       "      <th>place_id</th>\n",
       "      <th>day</th>\n",
       "      <th>cases/day</th>\n",
       "      <th>fatal/day</th>\n",
       "      <th>cases/day-(1-1)</th>\n",
       "      <th>cases/day-(1-7)</th>\n",
       "      <th>cases/day-(8-14)</th>\n",
       "      <th>cases/day-(15-21)</th>\n",
       "      <th>fatal/day-(1-1)</th>\n",
       "      <th>fatal/day-(1-7)</th>\n",
       "      <th>fatal/day-(8-14)</th>\n",
       "      <th>fatal/day-(15-21)</th>\n",
       "      <th>days_since_1cases</th>\n",
       "      <th>days_since_10cases</th>\n",
       "      <th>days_since_100cases</th>\n",
       "      <th>days_since_1fatal</th>\n",
       "      <th>days_since_10fatal</th>\n",
       "      <th>days_since_100fatal</th>\n",
       "      <th>SmokingRate</th>\n",
       "      <th>Country</th>\n",
       "      <th>Gross_domestic_product__constant_prices</th>\n",
       "      <th>Gross_domestic_product__current_prices</th>\n",
       "      <th>Gross_domestic_product__deflator</th>\n",
       "      <th>Gross_domestic_product_per_capita__constant_prices</th>\n",
       "      <th>Gross_domestic_product_per_capita__current_prices</th>\n",
       "      <th>Output_gap_in_percent_of_potential_GDP</th>\n",
       "      <th>Gross_domestic_product_based_on_purchasing_power_parity__PPP__valuation_of_country_GDP</th>\n",
       "      <th>Gross_domestic_product_based_on_purchasing_power_parity__PPP__per_capita_GDP</th>\n",
       "      <th>Gross_domestic_product_based_on_purchasing_power_parity__PPP__share_of_world_total</th>\n",
       "      <th>Implied_PPP_conversion_rate</th>\n",
       "      <th>Total_investment</th>\n",
       "      <th>Gross_national_savings</th>\n",
       "      <th>Inflation__average_consumer_prices</th>\n",
       "      <th>Inflation__end_of_period_consumer_prices</th>\n",
       "      <th>Six_month_London_interbank_offered_rate__LIBOR_</th>\n",
       "      <th>Volume_of_imports_of_goods_and_services</th>\n",
       "      <th>Volume_of_Imports_of_goods</th>\n",
       "      <th>Volume_of_exports_of_goods_and_services</th>\n",
       "      <th>Volume_of_exports_of_goods</th>\n",
       "      <th>Unemployment_rate</th>\n",
       "      <th>Employment</th>\n",
       "      <th>Population</th>\n",
       "      <th>General_government_revenue</th>\n",
       "      <th>General_government_total_expenditure</th>\n",
       "      <th>General_government_net_lending_borrowing</th>\n",
       "      <th>General_government_structural_balance</th>\n",
       "      <th>General_government_primary_net_lending_borrowing</th>\n",
       "      <th>General_government_net_debt</th>\n",
       "      <th>General_government_gross_debt</th>\n",
       "      <th>Gross_domestic_product_corresponding_to_fiscal_year__current_prices</th>\n",
       "      <th>Current_account_balance</th>\n",
       "      <th>LifeExpectancy</th>\n",
       "      <th>pop</th>\n",
       "      <th>density</th>\n",
       "      <th>medianage</th>\n",
       "      <th>urbanpop</th>\n",
       "      <th>quarantine</th>\n",
       "      <th>schools</th>\n",
       "      <th>hospibed</th>\n",
       "      <th>smokers</th>\n",
       "      <th>sex0</th>\n",
       "      <th>sex14</th>\n",
       "      <th>sex25</th>\n",
       "      <th>sex54</th>\n",
       "      <th>sex64</th>\n",
       "      <th>sex65plus</th>\n",
       "      <th>sexratio</th>\n",
       "      <th>lung</th>\n",
       "      <th>femalelung</th>\n",
       "      <th>malelung</th>\n",
       "    </tr>\n",
       "  </thead>\n",
       "  <tbody>\n",
       "    <tr>\n",
       "      <th>6360</th>\n",
       "      <td>5581.0</td>\n",
       "      <td>Hubei</td>\n",
       "      <td>China</td>\n",
       "      <td>30.9756</td>\n",
       "      <td>112.2707</td>\n",
       "      <td>2020-01-22</td>\n",
       "      <td>444.0</td>\n",
       "      <td>17.0</td>\n",
       "      <td>NaN</td>\n",
       "      <td>China/Hubei</td>\n",
       "      <td>22</td>\n",
       "      <td>444</td>\n",
       "      <td>17</td>\n",
       "      <td>0.0</td>\n",
       "      <td>0.0</td>\n",
       "      <td>0.0</td>\n",
       "      <td>0.0</td>\n",
       "      <td>0.0</td>\n",
       "      <td>0.0</td>\n",
       "      <td>0.0</td>\n",
       "      <td>0.0</td>\n",
       "      <td>35</td>\n",
       "      <td>22</td>\n",
       "      <td>4</td>\n",
       "      <td>13</td>\n",
       "      <td>0</td>\n",
       "      <td>0</td>\n",
       "      <td>25.6</td>\n",
       "      <td>China</td>\n",
       "      <td>89,473.25</td>\n",
       "      <td>95,199.40</td>\n",
       "      <td>106.4</td>\n",
       "      <td>63,579.45</td>\n",
       "      <td>67,648.44</td>\n",
       "      <td>NaN</td>\n",
       "      <td>27,272.31</td>\n",
       "      <td>19,379.63</td>\n",
       "      <td>19.191</td>\n",
       "      <td>3.491</td>\n",
       "      <td>42.674</td>\n",
       "      <td>43.9</td>\n",
       "      <td>125.931</td>\n",
       "      <td>123.888</td>\n",
       "      <td>NaN</td>\n",
       "      <td>3.877</td>\n",
       "      <td>3.6</td>\n",
       "      <td>2.689</td>\n",
       "      <td>3</td>\n",
       "      <td>4.02</td>\n",
       "      <td>NaN</td>\n",
       "      <td>1,407.27</td>\n",
       "      <td>26,023.24</td>\n",
       "      <td>29,245.77</td>\n",
       "      <td>-3,222.53</td>\n",
       "      <td>-3,233.26</td>\n",
       "      <td>-2,116.07</td>\n",
       "      <td>NaN</td>\n",
       "      <td>51,791.90</td>\n",
       "      <td>95,199.40</td>\n",
       "      <td>170.037</td>\n",
       "      <td>76.7</td>\n",
       "      <td>1,439,323,776</td>\n",
       "      <td>153.0</td>\n",
       "      <td>38.0</td>\n",
       "      <td>61.0</td>\n",
       "      <td>NaN</td>\n",
       "      <td>1/26/2020</td>\n",
       "      <td>4.2</td>\n",
       "      <td>24.7</td>\n",
       "      <td>1.15</td>\n",
       "      <td>1.17</td>\n",
       "      <td>1.14</td>\n",
       "      <td>1.04</td>\n",
       "      <td>1.02</td>\n",
       "      <td>0.92</td>\n",
       "      <td>1.06</td>\n",
       "      <td>63.1</td>\n",
       "      <td>56.35</td>\n",
       "      <td>70.52</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>6361</th>\n",
       "      <td>5582.0</td>\n",
       "      <td>Hubei</td>\n",
       "      <td>China</td>\n",
       "      <td>30.9756</td>\n",
       "      <td>112.2707</td>\n",
       "      <td>2020-01-23</td>\n",
       "      <td>444.0</td>\n",
       "      <td>17.0</td>\n",
       "      <td>NaN</td>\n",
       "      <td>China/Hubei</td>\n",
       "      <td>23</td>\n",
       "      <td>0</td>\n",
       "      <td>0</td>\n",
       "      <td>444.0</td>\n",
       "      <td>0.0</td>\n",
       "      <td>0.0</td>\n",
       "      <td>0.0</td>\n",
       "      <td>17.0</td>\n",
       "      <td>0.0</td>\n",
       "      <td>0.0</td>\n",
       "      <td>0.0</td>\n",
       "      <td>36</td>\n",
       "      <td>23</td>\n",
       "      <td>5</td>\n",
       "      <td>14</td>\n",
       "      <td>1</td>\n",
       "      <td>0</td>\n",
       "      <td>25.6</td>\n",
       "      <td>China</td>\n",
       "      <td>89,473.25</td>\n",
       "      <td>95,199.40</td>\n",
       "      <td>106.4</td>\n",
       "      <td>63,579.45</td>\n",
       "      <td>67,648.44</td>\n",
       "      <td>NaN</td>\n",
       "      <td>27,272.31</td>\n",
       "      <td>19,379.63</td>\n",
       "      <td>19.191</td>\n",
       "      <td>3.491</td>\n",
       "      <td>42.674</td>\n",
       "      <td>43.9</td>\n",
       "      <td>125.931</td>\n",
       "      <td>123.888</td>\n",
       "      <td>NaN</td>\n",
       "      <td>3.877</td>\n",
       "      <td>3.6</td>\n",
       "      <td>2.689</td>\n",
       "      <td>3</td>\n",
       "      <td>4.02</td>\n",
       "      <td>NaN</td>\n",
       "      <td>1,407.27</td>\n",
       "      <td>26,023.24</td>\n",
       "      <td>29,245.77</td>\n",
       "      <td>-3,222.53</td>\n",
       "      <td>-3,233.26</td>\n",
       "      <td>-2,116.07</td>\n",
       "      <td>NaN</td>\n",
       "      <td>51,791.90</td>\n",
       "      <td>95,199.40</td>\n",
       "      <td>170.037</td>\n",
       "      <td>76.7</td>\n",
       "      <td>1,439,323,776</td>\n",
       "      <td>153.0</td>\n",
       "      <td>38.0</td>\n",
       "      <td>61.0</td>\n",
       "      <td>NaN</td>\n",
       "      <td>1/26/2020</td>\n",
       "      <td>4.2</td>\n",
       "      <td>24.7</td>\n",
       "      <td>1.15</td>\n",
       "      <td>1.17</td>\n",
       "      <td>1.14</td>\n",
       "      <td>1.04</td>\n",
       "      <td>1.02</td>\n",
       "      <td>0.92</td>\n",
       "      <td>1.06</td>\n",
       "      <td>63.1</td>\n",
       "      <td>56.35</td>\n",
       "      <td>70.52</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>6362</th>\n",
       "      <td>5583.0</td>\n",
       "      <td>Hubei</td>\n",
       "      <td>China</td>\n",
       "      <td>30.9756</td>\n",
       "      <td>112.2707</td>\n",
       "      <td>2020-01-24</td>\n",
       "      <td>549.0</td>\n",
       "      <td>24.0</td>\n",
       "      <td>NaN</td>\n",
       "      <td>China/Hubei</td>\n",
       "      <td>24</td>\n",
       "      <td>105</td>\n",
       "      <td>7</td>\n",
       "      <td>0.0</td>\n",
       "      <td>0.0</td>\n",
       "      <td>0.0</td>\n",
       "      <td>0.0</td>\n",
       "      <td>0.0</td>\n",
       "      <td>0.0</td>\n",
       "      <td>0.0</td>\n",
       "      <td>0.0</td>\n",
       "      <td>37</td>\n",
       "      <td>24</td>\n",
       "      <td>6</td>\n",
       "      <td>15</td>\n",
       "      <td>2</td>\n",
       "      <td>0</td>\n",
       "      <td>25.6</td>\n",
       "      <td>China</td>\n",
       "      <td>89,473.25</td>\n",
       "      <td>95,199.40</td>\n",
       "      <td>106.4</td>\n",
       "      <td>63,579.45</td>\n",
       "      <td>67,648.44</td>\n",
       "      <td>NaN</td>\n",
       "      <td>27,272.31</td>\n",
       "      <td>19,379.63</td>\n",
       "      <td>19.191</td>\n",
       "      <td>3.491</td>\n",
       "      <td>42.674</td>\n",
       "      <td>43.9</td>\n",
       "      <td>125.931</td>\n",
       "      <td>123.888</td>\n",
       "      <td>NaN</td>\n",
       "      <td>3.877</td>\n",
       "      <td>3.6</td>\n",
       "      <td>2.689</td>\n",
       "      <td>3</td>\n",
       "      <td>4.02</td>\n",
       "      <td>NaN</td>\n",
       "      <td>1,407.27</td>\n",
       "      <td>26,023.24</td>\n",
       "      <td>29,245.77</td>\n",
       "      <td>-3,222.53</td>\n",
       "      <td>-3,233.26</td>\n",
       "      <td>-2,116.07</td>\n",
       "      <td>NaN</td>\n",
       "      <td>51,791.90</td>\n",
       "      <td>95,199.40</td>\n",
       "      <td>170.037</td>\n",
       "      <td>76.7</td>\n",
       "      <td>1,439,323,776</td>\n",
       "      <td>153.0</td>\n",
       "      <td>38.0</td>\n",
       "      <td>61.0</td>\n",
       "      <td>NaN</td>\n",
       "      <td>1/26/2020</td>\n",
       "      <td>4.2</td>\n",
       "      <td>24.7</td>\n",
       "      <td>1.15</td>\n",
       "      <td>1.17</td>\n",
       "      <td>1.14</td>\n",
       "      <td>1.04</td>\n",
       "      <td>1.02</td>\n",
       "      <td>0.92</td>\n",
       "      <td>1.06</td>\n",
       "      <td>63.1</td>\n",
       "      <td>56.35</td>\n",
       "      <td>70.52</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>6363</th>\n",
       "      <td>5584.0</td>\n",
       "      <td>Hubei</td>\n",
       "      <td>China</td>\n",
       "      <td>30.9756</td>\n",
       "      <td>112.2707</td>\n",
       "      <td>2020-01-25</td>\n",
       "      <td>761.0</td>\n",
       "      <td>40.0</td>\n",
       "      <td>NaN</td>\n",
       "      <td>China/Hubei</td>\n",
       "      <td>25</td>\n",
       "      <td>212</td>\n",
       "      <td>16</td>\n",
       "      <td>105.0</td>\n",
       "      <td>0.0</td>\n",
       "      <td>0.0</td>\n",
       "      <td>0.0</td>\n",
       "      <td>7.0</td>\n",
       "      <td>0.0</td>\n",
       "      <td>0.0</td>\n",
       "      <td>0.0</td>\n",
       "      <td>38</td>\n",
       "      <td>25</td>\n",
       "      <td>7</td>\n",
       "      <td>16</td>\n",
       "      <td>3</td>\n",
       "      <td>0</td>\n",
       "      <td>25.6</td>\n",
       "      <td>China</td>\n",
       "      <td>89,473.25</td>\n",
       "      <td>95,199.40</td>\n",
       "      <td>106.4</td>\n",
       "      <td>63,579.45</td>\n",
       "      <td>67,648.44</td>\n",
       "      <td>NaN</td>\n",
       "      <td>27,272.31</td>\n",
       "      <td>19,379.63</td>\n",
       "      <td>19.191</td>\n",
       "      <td>3.491</td>\n",
       "      <td>42.674</td>\n",
       "      <td>43.9</td>\n",
       "      <td>125.931</td>\n",
       "      <td>123.888</td>\n",
       "      <td>NaN</td>\n",
       "      <td>3.877</td>\n",
       "      <td>3.6</td>\n",
       "      <td>2.689</td>\n",
       "      <td>3</td>\n",
       "      <td>4.02</td>\n",
       "      <td>NaN</td>\n",
       "      <td>1,407.27</td>\n",
       "      <td>26,023.24</td>\n",
       "      <td>29,245.77</td>\n",
       "      <td>-3,222.53</td>\n",
       "      <td>-3,233.26</td>\n",
       "      <td>-2,116.07</td>\n",
       "      <td>NaN</td>\n",
       "      <td>51,791.90</td>\n",
       "      <td>95,199.40</td>\n",
       "      <td>170.037</td>\n",
       "      <td>76.7</td>\n",
       "      <td>1,439,323,776</td>\n",
       "      <td>153.0</td>\n",
       "      <td>38.0</td>\n",
       "      <td>61.0</td>\n",
       "      <td>NaN</td>\n",
       "      <td>1/26/2020</td>\n",
       "      <td>4.2</td>\n",
       "      <td>24.7</td>\n",
       "      <td>1.15</td>\n",
       "      <td>1.17</td>\n",
       "      <td>1.14</td>\n",
       "      <td>1.04</td>\n",
       "      <td>1.02</td>\n",
       "      <td>0.92</td>\n",
       "      <td>1.06</td>\n",
       "      <td>63.1</td>\n",
       "      <td>56.35</td>\n",
       "      <td>70.52</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>6364</th>\n",
       "      <td>5585.0</td>\n",
       "      <td>Hubei</td>\n",
       "      <td>China</td>\n",
       "      <td>30.9756</td>\n",
       "      <td>112.2707</td>\n",
       "      <td>2020-01-26</td>\n",
       "      <td>1058.0</td>\n",
       "      <td>52.0</td>\n",
       "      <td>NaN</td>\n",
       "      <td>China/Hubei</td>\n",
       "      <td>26</td>\n",
       "      <td>297</td>\n",
       "      <td>12</td>\n",
       "      <td>212.0</td>\n",
       "      <td>0.0</td>\n",
       "      <td>0.0</td>\n",
       "      <td>0.0</td>\n",
       "      <td>16.0</td>\n",
       "      <td>0.0</td>\n",
       "      <td>0.0</td>\n",
       "      <td>0.0</td>\n",
       "      <td>39</td>\n",
       "      <td>26</td>\n",
       "      <td>8</td>\n",
       "      <td>17</td>\n",
       "      <td>4</td>\n",
       "      <td>0</td>\n",
       "      <td>25.6</td>\n",
       "      <td>China</td>\n",
       "      <td>89,473.25</td>\n",
       "      <td>95,199.40</td>\n",
       "      <td>106.4</td>\n",
       "      <td>63,579.45</td>\n",
       "      <td>67,648.44</td>\n",
       "      <td>NaN</td>\n",
       "      <td>27,272.31</td>\n",
       "      <td>19,379.63</td>\n",
       "      <td>19.191</td>\n",
       "      <td>3.491</td>\n",
       "      <td>42.674</td>\n",
       "      <td>43.9</td>\n",
       "      <td>125.931</td>\n",
       "      <td>123.888</td>\n",
       "      <td>NaN</td>\n",
       "      <td>3.877</td>\n",
       "      <td>3.6</td>\n",
       "      <td>2.689</td>\n",
       "      <td>3</td>\n",
       "      <td>4.02</td>\n",
       "      <td>NaN</td>\n",
       "      <td>1,407.27</td>\n",
       "      <td>26,023.24</td>\n",
       "      <td>29,245.77</td>\n",
       "      <td>-3,222.53</td>\n",
       "      <td>-3,233.26</td>\n",
       "      <td>-2,116.07</td>\n",
       "      <td>NaN</td>\n",
       "      <td>51,791.90</td>\n",
       "      <td>95,199.40</td>\n",
       "      <td>170.037</td>\n",
       "      <td>76.7</td>\n",
       "      <td>1,439,323,776</td>\n",
       "      <td>153.0</td>\n",
       "      <td>38.0</td>\n",
       "      <td>61.0</td>\n",
       "      <td>NaN</td>\n",
       "      <td>1/26/2020</td>\n",
       "      <td>4.2</td>\n",
       "      <td>24.7</td>\n",
       "      <td>1.15</td>\n",
       "      <td>1.17</td>\n",
       "      <td>1.14</td>\n",
       "      <td>1.04</td>\n",
       "      <td>1.02</td>\n",
       "      <td>0.92</td>\n",
       "      <td>1.06</td>\n",
       "      <td>63.1</td>\n",
       "      <td>56.35</td>\n",
       "      <td>70.52</td>\n",
       "    </tr>\n",
       "  </tbody>\n",
       "</table>\n",
       "</div>"
      ],
      "text/plain": [
       "          Id Province/State Country/Region      Lat      Long       Date  \\\n",
       "6360  5581.0          Hubei          China  30.9756  112.2707 2020-01-22   \n",
       "6361  5582.0          Hubei          China  30.9756  112.2707 2020-01-23   \n",
       "6362  5583.0          Hubei          China  30.9756  112.2707 2020-01-24   \n",
       "6363  5584.0          Hubei          China  30.9756  112.2707 2020-01-25   \n",
       "6364  5585.0          Hubei          China  30.9756  112.2707 2020-01-26   \n",
       "\n",
       "      ConfirmedCases  Fatalities  ForecastId     place_id  day  cases/day  \\\n",
       "6360           444.0        17.0         NaN  China/Hubei   22        444   \n",
       "6361           444.0        17.0         NaN  China/Hubei   23          0   \n",
       "6362           549.0        24.0         NaN  China/Hubei   24        105   \n",
       "6363           761.0        40.0         NaN  China/Hubei   25        212   \n",
       "6364          1058.0        52.0         NaN  China/Hubei   26        297   \n",
       "\n",
       "      fatal/day  cases/day-(1-1)  cases/day-(1-7)  cases/day-(8-14)  \\\n",
       "6360         17              0.0              0.0               0.0   \n",
       "6361          0            444.0              0.0               0.0   \n",
       "6362          7              0.0              0.0               0.0   \n",
       "6363         16            105.0              0.0               0.0   \n",
       "6364         12            212.0              0.0               0.0   \n",
       "\n",
       "      cases/day-(15-21)  fatal/day-(1-1)  fatal/day-(1-7)  fatal/day-(8-14)  \\\n",
       "6360                0.0              0.0              0.0               0.0   \n",
       "6361                0.0             17.0              0.0               0.0   \n",
       "6362                0.0              0.0              0.0               0.0   \n",
       "6363                0.0              7.0              0.0               0.0   \n",
       "6364                0.0             16.0              0.0               0.0   \n",
       "\n",
       "      fatal/day-(15-21)  days_since_1cases  days_since_10cases  \\\n",
       "6360                0.0                 35                  22   \n",
       "6361                0.0                 36                  23   \n",
       "6362                0.0                 37                  24   \n",
       "6363                0.0                 38                  25   \n",
       "6364                0.0                 39                  26   \n",
       "\n",
       "      days_since_100cases  days_since_1fatal  days_since_10fatal  \\\n",
       "6360                    4                 13                   0   \n",
       "6361                    5                 14                   1   \n",
       "6362                    6                 15                   2   \n",
       "6363                    7                 16                   3   \n",
       "6364                    8                 17                   4   \n",
       "\n",
       "      days_since_100fatal  SmokingRate Country  \\\n",
       "6360                    0         25.6   China   \n",
       "6361                    0         25.6   China   \n",
       "6362                    0         25.6   China   \n",
       "6363                    0         25.6   China   \n",
       "6364                    0         25.6   China   \n",
       "\n",
       "     Gross_domestic_product__constant_prices  \\\n",
       "6360                               89,473.25   \n",
       "6361                               89,473.25   \n",
       "6362                               89,473.25   \n",
       "6363                               89,473.25   \n",
       "6364                               89,473.25   \n",
       "\n",
       "     Gross_domestic_product__current_prices Gross_domestic_product__deflator  \\\n",
       "6360                              95,199.40                            106.4   \n",
       "6361                              95,199.40                            106.4   \n",
       "6362                              95,199.40                            106.4   \n",
       "6363                              95,199.40                            106.4   \n",
       "6364                              95,199.40                            106.4   \n",
       "\n",
       "     Gross_domestic_product_per_capita__constant_prices  \\\n",
       "6360                                          63,579.45   \n",
       "6361                                          63,579.45   \n",
       "6362                                          63,579.45   \n",
       "6363                                          63,579.45   \n",
       "6364                                          63,579.45   \n",
       "\n",
       "     Gross_domestic_product_per_capita__current_prices  \\\n",
       "6360                                         67,648.44   \n",
       "6361                                         67,648.44   \n",
       "6362                                         67,648.44   \n",
       "6363                                         67,648.44   \n",
       "6364                                         67,648.44   \n",
       "\n",
       "     Output_gap_in_percent_of_potential_GDP  \\\n",
       "6360                                    NaN   \n",
       "6361                                    NaN   \n",
       "6362                                    NaN   \n",
       "6363                                    NaN   \n",
       "6364                                    NaN   \n",
       "\n",
       "     Gross_domestic_product_based_on_purchasing_power_parity__PPP__valuation_of_country_GDP  \\\n",
       "6360                                          27,272.31                                       \n",
       "6361                                          27,272.31                                       \n",
       "6362                                          27,272.31                                       \n",
       "6363                                          27,272.31                                       \n",
       "6364                                          27,272.31                                       \n",
       "\n",
       "     Gross_domestic_product_based_on_purchasing_power_parity__PPP__per_capita_GDP  \\\n",
       "6360                                          19,379.63                             \n",
       "6361                                          19,379.63                             \n",
       "6362                                          19,379.63                             \n",
       "6363                                          19,379.63                             \n",
       "6364                                          19,379.63                             \n",
       "\n",
       "     Gross_domestic_product_based_on_purchasing_power_parity__PPP__share_of_world_total  \\\n",
       "6360                                             19.191                                   \n",
       "6361                                             19.191                                   \n",
       "6362                                             19.191                                   \n",
       "6363                                             19.191                                   \n",
       "6364                                             19.191                                   \n",
       "\n",
       "     Implied_PPP_conversion_rate Total_investment Gross_national_savings  \\\n",
       "6360                       3.491           42.674                   43.9   \n",
       "6361                       3.491           42.674                   43.9   \n",
       "6362                       3.491           42.674                   43.9   \n",
       "6363                       3.491           42.674                   43.9   \n",
       "6364                       3.491           42.674                   43.9   \n",
       "\n",
       "     Inflation__average_consumer_prices  \\\n",
       "6360                            125.931   \n",
       "6361                            125.931   \n",
       "6362                            125.931   \n",
       "6363                            125.931   \n",
       "6364                            125.931   \n",
       "\n",
       "     Inflation__end_of_period_consumer_prices  \\\n",
       "6360                                  123.888   \n",
       "6361                                  123.888   \n",
       "6362                                  123.888   \n",
       "6363                                  123.888   \n",
       "6364                                  123.888   \n",
       "\n",
       "     Six_month_London_interbank_offered_rate__LIBOR_  \\\n",
       "6360                                             NaN   \n",
       "6361                                             NaN   \n",
       "6362                                             NaN   \n",
       "6363                                             NaN   \n",
       "6364                                             NaN   \n",
       "\n",
       "     Volume_of_imports_of_goods_and_services Volume_of_Imports_of_goods  \\\n",
       "6360                                   3.877                        3.6   \n",
       "6361                                   3.877                        3.6   \n",
       "6362                                   3.877                        3.6   \n",
       "6363                                   3.877                        3.6   \n",
       "6364                                   3.877                        3.6   \n",
       "\n",
       "     Volume_of_exports_of_goods_and_services Volume_of_exports_of_goods  \\\n",
       "6360                                   2.689                          3   \n",
       "6361                                   2.689                          3   \n",
       "6362                                   2.689                          3   \n",
       "6363                                   2.689                          3   \n",
       "6364                                   2.689                          3   \n",
       "\n",
       "     Unemployment_rate Employment Population General_government_revenue  \\\n",
       "6360              4.02        NaN   1,407.27                  26,023.24   \n",
       "6361              4.02        NaN   1,407.27                  26,023.24   \n",
       "6362              4.02        NaN   1,407.27                  26,023.24   \n",
       "6363              4.02        NaN   1,407.27                  26,023.24   \n",
       "6364              4.02        NaN   1,407.27                  26,023.24   \n",
       "\n",
       "     General_government_total_expenditure  \\\n",
       "6360                            29,245.77   \n",
       "6361                            29,245.77   \n",
       "6362                            29,245.77   \n",
       "6363                            29,245.77   \n",
       "6364                            29,245.77   \n",
       "\n",
       "     General_government_net_lending_borrowing  \\\n",
       "6360                                -3,222.53   \n",
       "6361                                -3,222.53   \n",
       "6362                                -3,222.53   \n",
       "6363                                -3,222.53   \n",
       "6364                                -3,222.53   \n",
       "\n",
       "     General_government_structural_balance  \\\n",
       "6360                             -3,233.26   \n",
       "6361                             -3,233.26   \n",
       "6362                             -3,233.26   \n",
       "6363                             -3,233.26   \n",
       "6364                             -3,233.26   \n",
       "\n",
       "     General_government_primary_net_lending_borrowing  \\\n",
       "6360                                        -2,116.07   \n",
       "6361                                        -2,116.07   \n",
       "6362                                        -2,116.07   \n",
       "6363                                        -2,116.07   \n",
       "6364                                        -2,116.07   \n",
       "\n",
       "     General_government_net_debt General_government_gross_debt  \\\n",
       "6360                         NaN                     51,791.90   \n",
       "6361                         NaN                     51,791.90   \n",
       "6362                         NaN                     51,791.90   \n",
       "6363                         NaN                     51,791.90   \n",
       "6364                         NaN                     51,791.90   \n",
       "\n",
       "     Gross_domestic_product_corresponding_to_fiscal_year__current_prices  \\\n",
       "6360                                          95,199.40                    \n",
       "6361                                          95,199.40                    \n",
       "6362                                          95,199.40                    \n",
       "6363                                          95,199.40                    \n",
       "6364                                          95,199.40                    \n",
       "\n",
       "     Current_account_balance  LifeExpectancy            pop  density  \\\n",
       "6360                 170.037            76.7  1,439,323,776    153.0   \n",
       "6361                 170.037            76.7  1,439,323,776    153.0   \n",
       "6362                 170.037            76.7  1,439,323,776    153.0   \n",
       "6363                 170.037            76.7  1,439,323,776    153.0   \n",
       "6364                 170.037            76.7  1,439,323,776    153.0   \n",
       "\n",
       "      medianage  urbanpop quarantine    schools  hospibed  smokers  sex0  \\\n",
       "6360       38.0      61.0        NaN  1/26/2020       4.2     24.7  1.15   \n",
       "6361       38.0      61.0        NaN  1/26/2020       4.2     24.7  1.15   \n",
       "6362       38.0      61.0        NaN  1/26/2020       4.2     24.7  1.15   \n",
       "6363       38.0      61.0        NaN  1/26/2020       4.2     24.7  1.15   \n",
       "6364       38.0      61.0        NaN  1/26/2020       4.2     24.7  1.15   \n",
       "\n",
       "      sex14  sex25  sex54  sex64  sex65plus  sexratio  lung  femalelung  \\\n",
       "6360   1.17   1.14   1.04   1.02       0.92      1.06  63.1       56.35   \n",
       "6361   1.17   1.14   1.04   1.02       0.92      1.06  63.1       56.35   \n",
       "6362   1.17   1.14   1.04   1.02       0.92      1.06  63.1       56.35   \n",
       "6363   1.17   1.14   1.04   1.02       0.92      1.06  63.1       56.35   \n",
       "6364   1.17   1.14   1.04   1.02       0.92      1.06  63.1       56.35   \n",
       "\n",
       "      malelung  \n",
       "6360     70.52  \n",
       "6361     70.52  \n",
       "6362     70.52  \n",
       "6363     70.52  \n",
       "6364     70.52  "
      ]
     },
     "execution_count": 83,
     "metadata": {},
     "output_type": "execute_result"
    }
   ],
   "source": [
    "df_traintest7[df_traintest7[\"place_id\"]==\"China/Hubei\"].head()"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 84,
   "metadata": {},
   "outputs": [],
   "source": [
    "#############################一段比较复杂的处理代码\n",
    "#############################主要的处理逻辑：\n",
    "#######给值存在的每个地区,国家赋予一个独一无二的地区标签"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 85,
   "metadata": {},
   "outputs": [
    {
     "name": "stderr",
     "output_type": "stream",
     "text": [
      "F:\\Anaconda\\lib\\site-packages\\ipykernel_launcher.py:2: SettingWithCopyWarning: \n",
      "A value is trying to be set on a copy of a slice from a DataFrame\n",
      "\n",
      "See the caveats in the documentation: https://pandas.pydata.org/pandas-docs/stable/user_guide/indexing.html#returning-a-view-versus-a-copy\n",
      "  \n"
     ]
    },
    {
     "name": "stdout",
     "output_type": "stream",
     "text": [
      "col: Country/Region, num_cat: 163, num_reduced: 163\n",
      "col: Province/State, num_cat: 129, num_reduced: 129\n"
     ]
    }
   ],
   "source": [
    "def encode_label(df, col, freq_limit=0):\n",
    "    df[col][pd.isna(df[col])] = 'nan'\n",
    "    tmp = df[col].value_counts()\n",
    "    cols = tmp.index.values               ######################cols是索引值\n",
    "    freq = tmp.values                   ######################freq是对应的值\n",
    "    num_cols = (freq>=freq_limit).sum()\n",
    "    print(\"col: {}, num_cat: {}, num_reduced: {}\".format(col, len(cols), num_cols))\n",
    "    col_new = '{}_le'.format(col)\n",
    "    df_new = pd.DataFrame(np.ones(len(df), np.int16)*(num_cols-1), columns=[col_new])\n",
    "    for i, item in enumerate(cols[:num_cols]):\n",
    "        df_new[col_new][df[col]==item] = i\n",
    "    return df_new\n",
    "\n",
    "def get_df_le(df, col_index, col_cat):\n",
    "    df_new = df[[col_index]]\n",
    "    for col in col_cat:\n",
    "        df_tmp = encode_label(df, col)\n",
    "        df_new = pd.concat([df_new, df_tmp], axis=1)\n",
    "    return df_new\n",
    "\n",
    "df_traintest7['id'] = np.arange(len(df_traintest7))\n",
    "df_le = get_df_le(df_traintest7, 'id', ['Country/Region', 'Province/State'])\n",
    "df_traintest8 = pd.merge(df_traintest7, df_le, on='id', how='left')"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 86,
   "metadata": {},
   "outputs": [],
   "source": [
    "df_traintest8['cases/day'] = df_traintest8['cases/day'].astype(np.float)\n",
    "df_traintest8['fatal/day'] = df_traintest8['fatal/day'].astype(np.float)"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 87,
   "metadata": {},
   "outputs": [
    {
     "data": {
      "text/html": [
       "<div>\n",
       "<style scoped>\n",
       "    .dataframe tbody tr th:only-of-type {\n",
       "        vertical-align: middle;\n",
       "    }\n",
       "\n",
       "    .dataframe tbody tr th {\n",
       "        vertical-align: top;\n",
       "    }\n",
       "\n",
       "    .dataframe thead th {\n",
       "        text-align: right;\n",
       "    }\n",
       "</style>\n",
       "<table border=\"1\" class=\"dataframe\">\n",
       "  <thead>\n",
       "    <tr style=\"text-align: right;\">\n",
       "      <th></th>\n",
       "      <th>Id</th>\n",
       "      <th>Province/State</th>\n",
       "      <th>Country/Region</th>\n",
       "      <th>Lat</th>\n",
       "      <th>Long</th>\n",
       "      <th>Date</th>\n",
       "      <th>ConfirmedCases</th>\n",
       "      <th>Fatalities</th>\n",
       "      <th>ForecastId</th>\n",
       "      <th>place_id</th>\n",
       "      <th>day</th>\n",
       "      <th>cases/day</th>\n",
       "      <th>fatal/day</th>\n",
       "      <th>cases/day-(1-1)</th>\n",
       "      <th>cases/day-(1-7)</th>\n",
       "      <th>cases/day-(8-14)</th>\n",
       "      <th>cases/day-(15-21)</th>\n",
       "      <th>fatal/day-(1-1)</th>\n",
       "      <th>fatal/day-(1-7)</th>\n",
       "      <th>fatal/day-(8-14)</th>\n",
       "      <th>fatal/day-(15-21)</th>\n",
       "      <th>days_since_1cases</th>\n",
       "      <th>days_since_10cases</th>\n",
       "      <th>days_since_100cases</th>\n",
       "      <th>days_since_1fatal</th>\n",
       "      <th>days_since_10fatal</th>\n",
       "      <th>days_since_100fatal</th>\n",
       "      <th>SmokingRate</th>\n",
       "      <th>Country</th>\n",
       "      <th>Gross_domestic_product__constant_prices</th>\n",
       "      <th>Gross_domestic_product__current_prices</th>\n",
       "      <th>Gross_domestic_product__deflator</th>\n",
       "      <th>Gross_domestic_product_per_capita__constant_prices</th>\n",
       "      <th>Gross_domestic_product_per_capita__current_prices</th>\n",
       "      <th>Output_gap_in_percent_of_potential_GDP</th>\n",
       "      <th>Gross_domestic_product_based_on_purchasing_power_parity__PPP__valuation_of_country_GDP</th>\n",
       "      <th>Gross_domestic_product_based_on_purchasing_power_parity__PPP__per_capita_GDP</th>\n",
       "      <th>Gross_domestic_product_based_on_purchasing_power_parity__PPP__share_of_world_total</th>\n",
       "      <th>Implied_PPP_conversion_rate</th>\n",
       "      <th>Total_investment</th>\n",
       "      <th>Gross_national_savings</th>\n",
       "      <th>Inflation__average_consumer_prices</th>\n",
       "      <th>Inflation__end_of_period_consumer_prices</th>\n",
       "      <th>Six_month_London_interbank_offered_rate__LIBOR_</th>\n",
       "      <th>Volume_of_imports_of_goods_and_services</th>\n",
       "      <th>Volume_of_Imports_of_goods</th>\n",
       "      <th>Volume_of_exports_of_goods_and_services</th>\n",
       "      <th>Volume_of_exports_of_goods</th>\n",
       "      <th>Unemployment_rate</th>\n",
       "      <th>Employment</th>\n",
       "      <th>Population</th>\n",
       "      <th>General_government_revenue</th>\n",
       "      <th>General_government_total_expenditure</th>\n",
       "      <th>General_government_net_lending_borrowing</th>\n",
       "      <th>General_government_structural_balance</th>\n",
       "      <th>General_government_primary_net_lending_borrowing</th>\n",
       "      <th>General_government_net_debt</th>\n",
       "      <th>General_government_gross_debt</th>\n",
       "      <th>Gross_domestic_product_corresponding_to_fiscal_year__current_prices</th>\n",
       "      <th>Current_account_balance</th>\n",
       "      <th>LifeExpectancy</th>\n",
       "      <th>pop</th>\n",
       "      <th>density</th>\n",
       "      <th>medianage</th>\n",
       "      <th>urbanpop</th>\n",
       "      <th>quarantine</th>\n",
       "      <th>schools</th>\n",
       "      <th>hospibed</th>\n",
       "      <th>smokers</th>\n",
       "      <th>sex0</th>\n",
       "      <th>sex14</th>\n",
       "      <th>sex25</th>\n",
       "      <th>sex54</th>\n",
       "      <th>sex64</th>\n",
       "      <th>sex65plus</th>\n",
       "      <th>sexratio</th>\n",
       "      <th>lung</th>\n",
       "      <th>femalelung</th>\n",
       "      <th>malelung</th>\n",
       "      <th>id</th>\n",
       "      <th>Country/Region_le</th>\n",
       "      <th>Province/State_le</th>\n",
       "    </tr>\n",
       "  </thead>\n",
       "  <tbody>\n",
       "    <tr>\n",
       "      <th>0</th>\n",
       "      <td>1.0</td>\n",
       "      <td>nan</td>\n",
       "      <td>Afghanistan</td>\n",
       "      <td>33.0</td>\n",
       "      <td>65.0</td>\n",
       "      <td>2020-01-22</td>\n",
       "      <td>0.0</td>\n",
       "      <td>0.0</td>\n",
       "      <td>NaN</td>\n",
       "      <td>Afghanistan</td>\n",
       "      <td>22</td>\n",
       "      <td>0.0</td>\n",
       "      <td>0.0</td>\n",
       "      <td>0.0</td>\n",
       "      <td>0.0</td>\n",
       "      <td>0.0</td>\n",
       "      <td>0.0</td>\n",
       "      <td>0.0</td>\n",
       "      <td>0.0</td>\n",
       "      <td>0.0</td>\n",
       "      <td>0.0</td>\n",
       "      <td>0</td>\n",
       "      <td>0</td>\n",
       "      <td>0</td>\n",
       "      <td>0</td>\n",
       "      <td>0</td>\n",
       "      <td>0</td>\n",
       "      <td>20.475517</td>\n",
       "      <td>Afghanistan</td>\n",
       "      <td>528.154</td>\n",
       "      <td>1,692.57</td>\n",
       "      <td>320.469</td>\n",
       "      <td>14,300.19</td>\n",
       "      <td>45,827.64</td>\n",
       "      <td>NaN</td>\n",
       "      <td>75.87</td>\n",
       "      <td>2,054.23</td>\n",
       "      <td>0.053</td>\n",
       "      <td>22.309</td>\n",
       "      <td>18.346</td>\n",
       "      <td>20.174</td>\n",
       "      <td>124.809</td>\n",
       "      <td>131.29</td>\n",
       "      <td>NaN</td>\n",
       "      <td>3.559</td>\n",
       "      <td>2.773</td>\n",
       "      <td>13.252</td>\n",
       "      <td>17.026</td>\n",
       "      <td>NaN</td>\n",
       "      <td>NaN</td>\n",
       "      <td>36.933</td>\n",
       "      <td>469.79</td>\n",
       "      <td>467.62</td>\n",
       "      <td>2.17</td>\n",
       "      <td>NaN</td>\n",
       "      <td>2.532</td>\n",
       "      <td>NaN</td>\n",
       "      <td>101.669</td>\n",
       "      <td>1,692.57</td>\n",
       "      <td>0.425</td>\n",
       "      <td>64.5</td>\n",
       "      <td>38,928,346</td>\n",
       "      <td>60.0</td>\n",
       "      <td>18.0</td>\n",
       "      <td>25.0</td>\n",
       "      <td>NaN</td>\n",
       "      <td>NaN</td>\n",
       "      <td>0.5</td>\n",
       "      <td>NaN</td>\n",
       "      <td>1.05</td>\n",
       "      <td>1.03</td>\n",
       "      <td>1.03</td>\n",
       "      <td>1.03</td>\n",
       "      <td>0.97</td>\n",
       "      <td>0.85</td>\n",
       "      <td>1.03</td>\n",
       "      <td>37.62</td>\n",
       "      <td>36.31</td>\n",
       "      <td>39.33</td>\n",
       "      <td>0</td>\n",
       "      <td>23</td>\n",
       "      <td>0</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>1</th>\n",
       "      <td>2.0</td>\n",
       "      <td>nan</td>\n",
       "      <td>Afghanistan</td>\n",
       "      <td>33.0</td>\n",
       "      <td>65.0</td>\n",
       "      <td>2020-01-23</td>\n",
       "      <td>0.0</td>\n",
       "      <td>0.0</td>\n",
       "      <td>NaN</td>\n",
       "      <td>Afghanistan</td>\n",
       "      <td>23</td>\n",
       "      <td>0.0</td>\n",
       "      <td>0.0</td>\n",
       "      <td>0.0</td>\n",
       "      <td>0.0</td>\n",
       "      <td>0.0</td>\n",
       "      <td>0.0</td>\n",
       "      <td>0.0</td>\n",
       "      <td>0.0</td>\n",
       "      <td>0.0</td>\n",
       "      <td>0.0</td>\n",
       "      <td>0</td>\n",
       "      <td>0</td>\n",
       "      <td>0</td>\n",
       "      <td>0</td>\n",
       "      <td>0</td>\n",
       "      <td>0</td>\n",
       "      <td>20.475517</td>\n",
       "      <td>Afghanistan</td>\n",
       "      <td>528.154</td>\n",
       "      <td>1,692.57</td>\n",
       "      <td>320.469</td>\n",
       "      <td>14,300.19</td>\n",
       "      <td>45,827.64</td>\n",
       "      <td>NaN</td>\n",
       "      <td>75.87</td>\n",
       "      <td>2,054.23</td>\n",
       "      <td>0.053</td>\n",
       "      <td>22.309</td>\n",
       "      <td>18.346</td>\n",
       "      <td>20.174</td>\n",
       "      <td>124.809</td>\n",
       "      <td>131.29</td>\n",
       "      <td>NaN</td>\n",
       "      <td>3.559</td>\n",
       "      <td>2.773</td>\n",
       "      <td>13.252</td>\n",
       "      <td>17.026</td>\n",
       "      <td>NaN</td>\n",
       "      <td>NaN</td>\n",
       "      <td>36.933</td>\n",
       "      <td>469.79</td>\n",
       "      <td>467.62</td>\n",
       "      <td>2.17</td>\n",
       "      <td>NaN</td>\n",
       "      <td>2.532</td>\n",
       "      <td>NaN</td>\n",
       "      <td>101.669</td>\n",
       "      <td>1,692.57</td>\n",
       "      <td>0.425</td>\n",
       "      <td>64.5</td>\n",
       "      <td>38,928,346</td>\n",
       "      <td>60.0</td>\n",
       "      <td>18.0</td>\n",
       "      <td>25.0</td>\n",
       "      <td>NaN</td>\n",
       "      <td>NaN</td>\n",
       "      <td>0.5</td>\n",
       "      <td>NaN</td>\n",
       "      <td>1.05</td>\n",
       "      <td>1.03</td>\n",
       "      <td>1.03</td>\n",
       "      <td>1.03</td>\n",
       "      <td>0.97</td>\n",
       "      <td>0.85</td>\n",
       "      <td>1.03</td>\n",
       "      <td>37.62</td>\n",
       "      <td>36.31</td>\n",
       "      <td>39.33</td>\n",
       "      <td>1</td>\n",
       "      <td>23</td>\n",
       "      <td>0</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>2</th>\n",
       "      <td>3.0</td>\n",
       "      <td>nan</td>\n",
       "      <td>Afghanistan</td>\n",
       "      <td>33.0</td>\n",
       "      <td>65.0</td>\n",
       "      <td>2020-01-24</td>\n",
       "      <td>0.0</td>\n",
       "      <td>0.0</td>\n",
       "      <td>NaN</td>\n",
       "      <td>Afghanistan</td>\n",
       "      <td>24</td>\n",
       "      <td>0.0</td>\n",
       "      <td>0.0</td>\n",
       "      <td>0.0</td>\n",
       "      <td>0.0</td>\n",
       "      <td>0.0</td>\n",
       "      <td>0.0</td>\n",
       "      <td>0.0</td>\n",
       "      <td>0.0</td>\n",
       "      <td>0.0</td>\n",
       "      <td>0.0</td>\n",
       "      <td>0</td>\n",
       "      <td>0</td>\n",
       "      <td>0</td>\n",
       "      <td>0</td>\n",
       "      <td>0</td>\n",
       "      <td>0</td>\n",
       "      <td>20.475517</td>\n",
       "      <td>Afghanistan</td>\n",
       "      <td>528.154</td>\n",
       "      <td>1,692.57</td>\n",
       "      <td>320.469</td>\n",
       "      <td>14,300.19</td>\n",
       "      <td>45,827.64</td>\n",
       "      <td>NaN</td>\n",
       "      <td>75.87</td>\n",
       "      <td>2,054.23</td>\n",
       "      <td>0.053</td>\n",
       "      <td>22.309</td>\n",
       "      <td>18.346</td>\n",
       "      <td>20.174</td>\n",
       "      <td>124.809</td>\n",
       "      <td>131.29</td>\n",
       "      <td>NaN</td>\n",
       "      <td>3.559</td>\n",
       "      <td>2.773</td>\n",
       "      <td>13.252</td>\n",
       "      <td>17.026</td>\n",
       "      <td>NaN</td>\n",
       "      <td>NaN</td>\n",
       "      <td>36.933</td>\n",
       "      <td>469.79</td>\n",
       "      <td>467.62</td>\n",
       "      <td>2.17</td>\n",
       "      <td>NaN</td>\n",
       "      <td>2.532</td>\n",
       "      <td>NaN</td>\n",
       "      <td>101.669</td>\n",
       "      <td>1,692.57</td>\n",
       "      <td>0.425</td>\n",
       "      <td>64.5</td>\n",
       "      <td>38,928,346</td>\n",
       "      <td>60.0</td>\n",
       "      <td>18.0</td>\n",
       "      <td>25.0</td>\n",
       "      <td>NaN</td>\n",
       "      <td>NaN</td>\n",
       "      <td>0.5</td>\n",
       "      <td>NaN</td>\n",
       "      <td>1.05</td>\n",
       "      <td>1.03</td>\n",
       "      <td>1.03</td>\n",
       "      <td>1.03</td>\n",
       "      <td>0.97</td>\n",
       "      <td>0.85</td>\n",
       "      <td>1.03</td>\n",
       "      <td>37.62</td>\n",
       "      <td>36.31</td>\n",
       "      <td>39.33</td>\n",
       "      <td>2</td>\n",
       "      <td>23</td>\n",
       "      <td>0</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>3</th>\n",
       "      <td>4.0</td>\n",
       "      <td>nan</td>\n",
       "      <td>Afghanistan</td>\n",
       "      <td>33.0</td>\n",
       "      <td>65.0</td>\n",
       "      <td>2020-01-25</td>\n",
       "      <td>0.0</td>\n",
       "      <td>0.0</td>\n",
       "      <td>NaN</td>\n",
       "      <td>Afghanistan</td>\n",
       "      <td>25</td>\n",
       "      <td>0.0</td>\n",
       "      <td>0.0</td>\n",
       "      <td>0.0</td>\n",
       "      <td>0.0</td>\n",
       "      <td>0.0</td>\n",
       "      <td>0.0</td>\n",
       "      <td>0.0</td>\n",
       "      <td>0.0</td>\n",
       "      <td>0.0</td>\n",
       "      <td>0.0</td>\n",
       "      <td>0</td>\n",
       "      <td>0</td>\n",
       "      <td>0</td>\n",
       "      <td>0</td>\n",
       "      <td>0</td>\n",
       "      <td>0</td>\n",
       "      <td>20.475517</td>\n",
       "      <td>Afghanistan</td>\n",
       "      <td>528.154</td>\n",
       "      <td>1,692.57</td>\n",
       "      <td>320.469</td>\n",
       "      <td>14,300.19</td>\n",
       "      <td>45,827.64</td>\n",
       "      <td>NaN</td>\n",
       "      <td>75.87</td>\n",
       "      <td>2,054.23</td>\n",
       "      <td>0.053</td>\n",
       "      <td>22.309</td>\n",
       "      <td>18.346</td>\n",
       "      <td>20.174</td>\n",
       "      <td>124.809</td>\n",
       "      <td>131.29</td>\n",
       "      <td>NaN</td>\n",
       "      <td>3.559</td>\n",
       "      <td>2.773</td>\n",
       "      <td>13.252</td>\n",
       "      <td>17.026</td>\n",
       "      <td>NaN</td>\n",
       "      <td>NaN</td>\n",
       "      <td>36.933</td>\n",
       "      <td>469.79</td>\n",
       "      <td>467.62</td>\n",
       "      <td>2.17</td>\n",
       "      <td>NaN</td>\n",
       "      <td>2.532</td>\n",
       "      <td>NaN</td>\n",
       "      <td>101.669</td>\n",
       "      <td>1,692.57</td>\n",
       "      <td>0.425</td>\n",
       "      <td>64.5</td>\n",
       "      <td>38,928,346</td>\n",
       "      <td>60.0</td>\n",
       "      <td>18.0</td>\n",
       "      <td>25.0</td>\n",
       "      <td>NaN</td>\n",
       "      <td>NaN</td>\n",
       "      <td>0.5</td>\n",
       "      <td>NaN</td>\n",
       "      <td>1.05</td>\n",
       "      <td>1.03</td>\n",
       "      <td>1.03</td>\n",
       "      <td>1.03</td>\n",
       "      <td>0.97</td>\n",
       "      <td>0.85</td>\n",
       "      <td>1.03</td>\n",
       "      <td>37.62</td>\n",
       "      <td>36.31</td>\n",
       "      <td>39.33</td>\n",
       "      <td>3</td>\n",
       "      <td>23</td>\n",
       "      <td>0</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>4</th>\n",
       "      <td>5.0</td>\n",
       "      <td>nan</td>\n",
       "      <td>Afghanistan</td>\n",
       "      <td>33.0</td>\n",
       "      <td>65.0</td>\n",
       "      <td>2020-01-26</td>\n",
       "      <td>0.0</td>\n",
       "      <td>0.0</td>\n",
       "      <td>NaN</td>\n",
       "      <td>Afghanistan</td>\n",
       "      <td>26</td>\n",
       "      <td>0.0</td>\n",
       "      <td>0.0</td>\n",
       "      <td>0.0</td>\n",
       "      <td>0.0</td>\n",
       "      <td>0.0</td>\n",
       "      <td>0.0</td>\n",
       "      <td>0.0</td>\n",
       "      <td>0.0</td>\n",
       "      <td>0.0</td>\n",
       "      <td>0.0</td>\n",
       "      <td>0</td>\n",
       "      <td>0</td>\n",
       "      <td>0</td>\n",
       "      <td>0</td>\n",
       "      <td>0</td>\n",
       "      <td>0</td>\n",
       "      <td>20.475517</td>\n",
       "      <td>Afghanistan</td>\n",
       "      <td>528.154</td>\n",
       "      <td>1,692.57</td>\n",
       "      <td>320.469</td>\n",
       "      <td>14,300.19</td>\n",
       "      <td>45,827.64</td>\n",
       "      <td>NaN</td>\n",
       "      <td>75.87</td>\n",
       "      <td>2,054.23</td>\n",
       "      <td>0.053</td>\n",
       "      <td>22.309</td>\n",
       "      <td>18.346</td>\n",
       "      <td>20.174</td>\n",
       "      <td>124.809</td>\n",
       "      <td>131.29</td>\n",
       "      <td>NaN</td>\n",
       "      <td>3.559</td>\n",
       "      <td>2.773</td>\n",
       "      <td>13.252</td>\n",
       "      <td>17.026</td>\n",
       "      <td>NaN</td>\n",
       "      <td>NaN</td>\n",
       "      <td>36.933</td>\n",
       "      <td>469.79</td>\n",
       "      <td>467.62</td>\n",
       "      <td>2.17</td>\n",
       "      <td>NaN</td>\n",
       "      <td>2.532</td>\n",
       "      <td>NaN</td>\n",
       "      <td>101.669</td>\n",
       "      <td>1,692.57</td>\n",
       "      <td>0.425</td>\n",
       "      <td>64.5</td>\n",
       "      <td>38,928,346</td>\n",
       "      <td>60.0</td>\n",
       "      <td>18.0</td>\n",
       "      <td>25.0</td>\n",
       "      <td>NaN</td>\n",
       "      <td>NaN</td>\n",
       "      <td>0.5</td>\n",
       "      <td>NaN</td>\n",
       "      <td>1.05</td>\n",
       "      <td>1.03</td>\n",
       "      <td>1.03</td>\n",
       "      <td>1.03</td>\n",
       "      <td>0.97</td>\n",
       "      <td>0.85</td>\n",
       "      <td>1.03</td>\n",
       "      <td>37.62</td>\n",
       "      <td>36.31</td>\n",
       "      <td>39.33</td>\n",
       "      <td>4</td>\n",
       "      <td>23</td>\n",
       "      <td>0</td>\n",
       "    </tr>\n",
       "  </tbody>\n",
       "</table>\n",
       "</div>"
      ],
      "text/plain": [
       "    Id Province/State Country/Region   Lat  Long       Date  ConfirmedCases  \\\n",
       "0  1.0            nan    Afghanistan  33.0  65.0 2020-01-22             0.0   \n",
       "1  2.0            nan    Afghanistan  33.0  65.0 2020-01-23             0.0   \n",
       "2  3.0            nan    Afghanistan  33.0  65.0 2020-01-24             0.0   \n",
       "3  4.0            nan    Afghanistan  33.0  65.0 2020-01-25             0.0   \n",
       "4  5.0            nan    Afghanistan  33.0  65.0 2020-01-26             0.0   \n",
       "\n",
       "   Fatalities  ForecastId     place_id  day  cases/day  fatal/day  \\\n",
       "0         0.0         NaN  Afghanistan   22        0.0        0.0   \n",
       "1         0.0         NaN  Afghanistan   23        0.0        0.0   \n",
       "2         0.0         NaN  Afghanistan   24        0.0        0.0   \n",
       "3         0.0         NaN  Afghanistan   25        0.0        0.0   \n",
       "4         0.0         NaN  Afghanistan   26        0.0        0.0   \n",
       "\n",
       "   cases/day-(1-1)  cases/day-(1-7)  cases/day-(8-14)  cases/day-(15-21)  \\\n",
       "0              0.0              0.0               0.0                0.0   \n",
       "1              0.0              0.0               0.0                0.0   \n",
       "2              0.0              0.0               0.0                0.0   \n",
       "3              0.0              0.0               0.0                0.0   \n",
       "4              0.0              0.0               0.0                0.0   \n",
       "\n",
       "   fatal/day-(1-1)  fatal/day-(1-7)  fatal/day-(8-14)  fatal/day-(15-21)  \\\n",
       "0              0.0              0.0               0.0                0.0   \n",
       "1              0.0              0.0               0.0                0.0   \n",
       "2              0.0              0.0               0.0                0.0   \n",
       "3              0.0              0.0               0.0                0.0   \n",
       "4              0.0              0.0               0.0                0.0   \n",
       "\n",
       "   days_since_1cases  days_since_10cases  days_since_100cases  \\\n",
       "0                  0                   0                    0   \n",
       "1                  0                   0                    0   \n",
       "2                  0                   0                    0   \n",
       "3                  0                   0                    0   \n",
       "4                  0                   0                    0   \n",
       "\n",
       "   days_since_1fatal  days_since_10fatal  days_since_100fatal  SmokingRate  \\\n",
       "0                  0                   0                    0    20.475517   \n",
       "1                  0                   0                    0    20.475517   \n",
       "2                  0                   0                    0    20.475517   \n",
       "3                  0                   0                    0    20.475517   \n",
       "4                  0                   0                    0    20.475517   \n",
       "\n",
       "       Country Gross_domestic_product__constant_prices  \\\n",
       "0  Afghanistan                                 528.154   \n",
       "1  Afghanistan                                 528.154   \n",
       "2  Afghanistan                                 528.154   \n",
       "3  Afghanistan                                 528.154   \n",
       "4  Afghanistan                                 528.154   \n",
       "\n",
       "  Gross_domestic_product__current_prices Gross_domestic_product__deflator  \\\n",
       "0                               1,692.57                          320.469   \n",
       "1                               1,692.57                          320.469   \n",
       "2                               1,692.57                          320.469   \n",
       "3                               1,692.57                          320.469   \n",
       "4                               1,692.57                          320.469   \n",
       "\n",
       "  Gross_domestic_product_per_capita__constant_prices  \\\n",
       "0                                          14,300.19   \n",
       "1                                          14,300.19   \n",
       "2                                          14,300.19   \n",
       "3                                          14,300.19   \n",
       "4                                          14,300.19   \n",
       "\n",
       "  Gross_domestic_product_per_capita__current_prices  \\\n",
       "0                                         45,827.64   \n",
       "1                                         45,827.64   \n",
       "2                                         45,827.64   \n",
       "3                                         45,827.64   \n",
       "4                                         45,827.64   \n",
       "\n",
       "  Output_gap_in_percent_of_potential_GDP  \\\n",
       "0                                    NaN   \n",
       "1                                    NaN   \n",
       "2                                    NaN   \n",
       "3                                    NaN   \n",
       "4                                    NaN   \n",
       "\n",
       "  Gross_domestic_product_based_on_purchasing_power_parity__PPP__valuation_of_country_GDP  \\\n",
       "0                                              75.87                                       \n",
       "1                                              75.87                                       \n",
       "2                                              75.87                                       \n",
       "3                                              75.87                                       \n",
       "4                                              75.87                                       \n",
       "\n",
       "  Gross_domestic_product_based_on_purchasing_power_parity__PPP__per_capita_GDP  \\\n",
       "0                                           2,054.23                             \n",
       "1                                           2,054.23                             \n",
       "2                                           2,054.23                             \n",
       "3                                           2,054.23                             \n",
       "4                                           2,054.23                             \n",
       "\n",
       "  Gross_domestic_product_based_on_purchasing_power_parity__PPP__share_of_world_total  \\\n",
       "0                                              0.053                                   \n",
       "1                                              0.053                                   \n",
       "2                                              0.053                                   \n",
       "3                                              0.053                                   \n",
       "4                                              0.053                                   \n",
       "\n",
       "  Implied_PPP_conversion_rate Total_investment Gross_national_savings  \\\n",
       "0                      22.309           18.346                 20.174   \n",
       "1                      22.309           18.346                 20.174   \n",
       "2                      22.309           18.346                 20.174   \n",
       "3                      22.309           18.346                 20.174   \n",
       "4                      22.309           18.346                 20.174   \n",
       "\n",
       "  Inflation__average_consumer_prices Inflation__end_of_period_consumer_prices  \\\n",
       "0                            124.809                                   131.29   \n",
       "1                            124.809                                   131.29   \n",
       "2                            124.809                                   131.29   \n",
       "3                            124.809                                   131.29   \n",
       "4                            124.809                                   131.29   \n",
       "\n",
       "  Six_month_London_interbank_offered_rate__LIBOR_  \\\n",
       "0                                             NaN   \n",
       "1                                             NaN   \n",
       "2                                             NaN   \n",
       "3                                             NaN   \n",
       "4                                             NaN   \n",
       "\n",
       "  Volume_of_imports_of_goods_and_services Volume_of_Imports_of_goods  \\\n",
       "0                                   3.559                      2.773   \n",
       "1                                   3.559                      2.773   \n",
       "2                                   3.559                      2.773   \n",
       "3                                   3.559                      2.773   \n",
       "4                                   3.559                      2.773   \n",
       "\n",
       "  Volume_of_exports_of_goods_and_services Volume_of_exports_of_goods  \\\n",
       "0                                  13.252                     17.026   \n",
       "1                                  13.252                     17.026   \n",
       "2                                  13.252                     17.026   \n",
       "3                                  13.252                     17.026   \n",
       "4                                  13.252                     17.026   \n",
       "\n",
       "  Unemployment_rate Employment Population General_government_revenue  \\\n",
       "0               NaN        NaN     36.933                     469.79   \n",
       "1               NaN        NaN     36.933                     469.79   \n",
       "2               NaN        NaN     36.933                     469.79   \n",
       "3               NaN        NaN     36.933                     469.79   \n",
       "4               NaN        NaN     36.933                     469.79   \n",
       "\n",
       "  General_government_total_expenditure  \\\n",
       "0                               467.62   \n",
       "1                               467.62   \n",
       "2                               467.62   \n",
       "3                               467.62   \n",
       "4                               467.62   \n",
       "\n",
       "  General_government_net_lending_borrowing  \\\n",
       "0                                     2.17   \n",
       "1                                     2.17   \n",
       "2                                     2.17   \n",
       "3                                     2.17   \n",
       "4                                     2.17   \n",
       "\n",
       "  General_government_structural_balance  \\\n",
       "0                                   NaN   \n",
       "1                                   NaN   \n",
       "2                                   NaN   \n",
       "3                                   NaN   \n",
       "4                                   NaN   \n",
       "\n",
       "  General_government_primary_net_lending_borrowing  \\\n",
       "0                                            2.532   \n",
       "1                                            2.532   \n",
       "2                                            2.532   \n",
       "3                                            2.532   \n",
       "4                                            2.532   \n",
       "\n",
       "  General_government_net_debt General_government_gross_debt  \\\n",
       "0                         NaN                       101.669   \n",
       "1                         NaN                       101.669   \n",
       "2                         NaN                       101.669   \n",
       "3                         NaN                       101.669   \n",
       "4                         NaN                       101.669   \n",
       "\n",
       "  Gross_domestic_product_corresponding_to_fiscal_year__current_prices  \\\n",
       "0                                           1,692.57                    \n",
       "1                                           1,692.57                    \n",
       "2                                           1,692.57                    \n",
       "3                                           1,692.57                    \n",
       "4                                           1,692.57                    \n",
       "\n",
       "  Current_account_balance  LifeExpectancy         pop  density  medianage  \\\n",
       "0                   0.425            64.5  38,928,346     60.0       18.0   \n",
       "1                   0.425            64.5  38,928,346     60.0       18.0   \n",
       "2                   0.425            64.5  38,928,346     60.0       18.0   \n",
       "3                   0.425            64.5  38,928,346     60.0       18.0   \n",
       "4                   0.425            64.5  38,928,346     60.0       18.0   \n",
       "\n",
       "   urbanpop quarantine schools  hospibed  smokers  sex0  sex14  sex25  sex54  \\\n",
       "0      25.0        NaN     NaN       0.5      NaN  1.05   1.03   1.03   1.03   \n",
       "1      25.0        NaN     NaN       0.5      NaN  1.05   1.03   1.03   1.03   \n",
       "2      25.0        NaN     NaN       0.5      NaN  1.05   1.03   1.03   1.03   \n",
       "3      25.0        NaN     NaN       0.5      NaN  1.05   1.03   1.03   1.03   \n",
       "4      25.0        NaN     NaN       0.5      NaN  1.05   1.03   1.03   1.03   \n",
       "\n",
       "   sex64  sex65plus  sexratio   lung  femalelung  malelung  id  \\\n",
       "0   0.97       0.85      1.03  37.62       36.31     39.33   0   \n",
       "1   0.97       0.85      1.03  37.62       36.31     39.33   1   \n",
       "2   0.97       0.85      1.03  37.62       36.31     39.33   2   \n",
       "3   0.97       0.85      1.03  37.62       36.31     39.33   3   \n",
       "4   0.97       0.85      1.03  37.62       36.31     39.33   4   \n",
       "\n",
       "   Country/Region_le  Province/State_le  \n",
       "0                 23                  0  \n",
       "1                 23                  0  \n",
       "2                 23                  0  \n",
       "3                 23                  0  \n",
       "4                 23                  0  "
      ]
     },
     "execution_count": 87,
     "metadata": {},
     "output_type": "execute_result"
    }
   ],
   "source": [
    "df_traintest8.head()"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 88,
   "metadata": {},
   "outputs": [
    {
     "name": "stdout",
     "output_type": "stream",
     "text": [
      "float64\n"
     ]
    }
   ],
   "source": [
    "# covert object type to float\n",
    "def func(x):\n",
    "    x_new = 0\n",
    "    try:\n",
    "        x_new = float(x.replace(\",\", \"\"))\n",
    "    except:\n",
    "        x_new = np.nan\n",
    "    return x_new\n",
    "cols = [\n",
    "    'Gross_domestic_product__constant_prices', \n",
    "    'Gross_domestic_product__current_prices', \n",
    "    'Gross_domestic_product__deflator', \n",
    "    'Gross_domestic_product_per_capita__constant_prices', \n",
    "    'Gross_domestic_product_per_capita__current_prices', \n",
    "    'Output_gap_in_percent_of_potential_GDP', \n",
    "    'Gross_domestic_product_based_on_purchasing_power_parity__PPP__valuation_of_country_GDP', \n",
    "    'Gross_domestic_product_based_on_purchasing_power_parity__PPP__per_capita_GDP', \n",
    "    'Gross_domestic_product_based_on_purchasing_power_parity__PPP__share_of_world_total', \n",
    "    'Implied_PPP_conversion_rate', 'Total_investment', \n",
    "    'Gross_national_savings', 'Inflation__average_consumer_prices', \n",
    "    'Inflation__end_of_period_consumer_prices', \n",
    "    'Six_month_London_interbank_offered_rate__LIBOR_', \n",
    "    'Volume_of_imports_of_goods_and_services', \n",
    "    'Volume_of_Imports_of_goods', \n",
    "    'Volume_of_exports_of_goods_and_services', \n",
    "    'Volume_of_exports_of_goods', 'Unemployment_rate', 'Employment', 'Population', \n",
    "    'General_government_revenue', 'General_government_total_expenditure', \n",
    "    'General_government_net_lending_borrowing', 'General_government_structural_balance', \n",
    "    'General_government_primary_net_lending_borrowing', 'General_government_net_debt', \n",
    "    'General_government_gross_debt', 'Gross_domestic_product_corresponding_to_fiscal_year__current_prices', \n",
    "    'Current_account_balance', 'pop'\n",
    "]\n",
    "for col in cols:\n",
    "    df_traintest8[col] = df_traintest8[col].apply(lambda x: func(x))  \n",
    "print(df_traintest8['pop'].dtype)"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 89,
   "metadata": {
    "scrolled": true
   },
   "outputs": [
    {
     "data": {
      "text/html": [
       "<div>\n",
       "<style scoped>\n",
       "    .dataframe tbody tr th:only-of-type {\n",
       "        vertical-align: middle;\n",
       "    }\n",
       "\n",
       "    .dataframe tbody tr th {\n",
       "        vertical-align: top;\n",
       "    }\n",
       "\n",
       "    .dataframe thead th {\n",
       "        text-align: right;\n",
       "    }\n",
       "</style>\n",
       "<table border=\"1\" class=\"dataframe\">\n",
       "  <thead>\n",
       "    <tr style=\"text-align: right;\">\n",
       "      <th></th>\n",
       "      <th>Id</th>\n",
       "      <th>Province/State</th>\n",
       "      <th>Country/Region</th>\n",
       "      <th>Lat</th>\n",
       "      <th>Long</th>\n",
       "      <th>Date</th>\n",
       "      <th>ConfirmedCases</th>\n",
       "      <th>Fatalities</th>\n",
       "      <th>ForecastId</th>\n",
       "      <th>place_id</th>\n",
       "      <th>day</th>\n",
       "      <th>cases/day</th>\n",
       "      <th>fatal/day</th>\n",
       "      <th>cases/day-(1-1)</th>\n",
       "      <th>cases/day-(1-7)</th>\n",
       "      <th>cases/day-(8-14)</th>\n",
       "      <th>cases/day-(15-21)</th>\n",
       "      <th>fatal/day-(1-1)</th>\n",
       "      <th>fatal/day-(1-7)</th>\n",
       "      <th>fatal/day-(8-14)</th>\n",
       "      <th>fatal/day-(15-21)</th>\n",
       "      <th>days_since_1cases</th>\n",
       "      <th>days_since_10cases</th>\n",
       "      <th>days_since_100cases</th>\n",
       "      <th>days_since_1fatal</th>\n",
       "      <th>days_since_10fatal</th>\n",
       "      <th>days_since_100fatal</th>\n",
       "      <th>SmokingRate</th>\n",
       "      <th>Country</th>\n",
       "      <th>Gross_domestic_product__constant_prices</th>\n",
       "      <th>Gross_domestic_product__current_prices</th>\n",
       "      <th>Gross_domestic_product__deflator</th>\n",
       "      <th>Gross_domestic_product_per_capita__constant_prices</th>\n",
       "      <th>Gross_domestic_product_per_capita__current_prices</th>\n",
       "      <th>Output_gap_in_percent_of_potential_GDP</th>\n",
       "      <th>Gross_domestic_product_based_on_purchasing_power_parity__PPP__valuation_of_country_GDP</th>\n",
       "      <th>Gross_domestic_product_based_on_purchasing_power_parity__PPP__per_capita_GDP</th>\n",
       "      <th>Gross_domestic_product_based_on_purchasing_power_parity__PPP__share_of_world_total</th>\n",
       "      <th>Implied_PPP_conversion_rate</th>\n",
       "      <th>Total_investment</th>\n",
       "      <th>Gross_national_savings</th>\n",
       "      <th>Inflation__average_consumer_prices</th>\n",
       "      <th>Inflation__end_of_period_consumer_prices</th>\n",
       "      <th>Six_month_London_interbank_offered_rate__LIBOR_</th>\n",
       "      <th>Volume_of_imports_of_goods_and_services</th>\n",
       "      <th>Volume_of_Imports_of_goods</th>\n",
       "      <th>Volume_of_exports_of_goods_and_services</th>\n",
       "      <th>Volume_of_exports_of_goods</th>\n",
       "      <th>Unemployment_rate</th>\n",
       "      <th>Employment</th>\n",
       "      <th>Population</th>\n",
       "      <th>General_government_revenue</th>\n",
       "      <th>General_government_total_expenditure</th>\n",
       "      <th>General_government_net_lending_borrowing</th>\n",
       "      <th>General_government_structural_balance</th>\n",
       "      <th>General_government_primary_net_lending_borrowing</th>\n",
       "      <th>General_government_net_debt</th>\n",
       "      <th>General_government_gross_debt</th>\n",
       "      <th>Gross_domestic_product_corresponding_to_fiscal_year__current_prices</th>\n",
       "      <th>Current_account_balance</th>\n",
       "      <th>LifeExpectancy</th>\n",
       "      <th>pop</th>\n",
       "      <th>density</th>\n",
       "      <th>medianage</th>\n",
       "      <th>urbanpop</th>\n",
       "      <th>quarantine</th>\n",
       "      <th>schools</th>\n",
       "      <th>hospibed</th>\n",
       "      <th>smokers</th>\n",
       "      <th>sex0</th>\n",
       "      <th>sex14</th>\n",
       "      <th>sex25</th>\n",
       "      <th>sex54</th>\n",
       "      <th>sex64</th>\n",
       "      <th>sex65plus</th>\n",
       "      <th>sexratio</th>\n",
       "      <th>lung</th>\n",
       "      <th>femalelung</th>\n",
       "      <th>malelung</th>\n",
       "      <th>id</th>\n",
       "      <th>Country/Region_le</th>\n",
       "      <th>Province/State_le</th>\n",
       "    </tr>\n",
       "  </thead>\n",
       "  <tbody>\n",
       "    <tr>\n",
       "      <th>6360</th>\n",
       "      <td>5581.0</td>\n",
       "      <td>Hubei</td>\n",
       "      <td>China</td>\n",
       "      <td>30.9756</td>\n",
       "      <td>112.2707</td>\n",
       "      <td>2020-01-22</td>\n",
       "      <td>444.0</td>\n",
       "      <td>17.0</td>\n",
       "      <td>NaN</td>\n",
       "      <td>China/Hubei</td>\n",
       "      <td>22</td>\n",
       "      <td>444.0</td>\n",
       "      <td>17.0</td>\n",
       "      <td>0.0</td>\n",
       "      <td>0.0</td>\n",
       "      <td>0.0</td>\n",
       "      <td>0.0</td>\n",
       "      <td>0.0</td>\n",
       "      <td>0.0</td>\n",
       "      <td>0.0</td>\n",
       "      <td>0.0</td>\n",
       "      <td>35</td>\n",
       "      <td>22</td>\n",
       "      <td>4</td>\n",
       "      <td>13</td>\n",
       "      <td>0</td>\n",
       "      <td>0</td>\n",
       "      <td>25.6</td>\n",
       "      <td>China</td>\n",
       "      <td>89473.25</td>\n",
       "      <td>95199.4</td>\n",
       "      <td>106.4</td>\n",
       "      <td>63579.45</td>\n",
       "      <td>67648.44</td>\n",
       "      <td>NaN</td>\n",
       "      <td>27272.31</td>\n",
       "      <td>19379.63</td>\n",
       "      <td>19.191</td>\n",
       "      <td>3.491</td>\n",
       "      <td>42.674</td>\n",
       "      <td>43.9</td>\n",
       "      <td>125.931</td>\n",
       "      <td>123.888</td>\n",
       "      <td>NaN</td>\n",
       "      <td>3.877</td>\n",
       "      <td>3.6</td>\n",
       "      <td>2.689</td>\n",
       "      <td>3.0</td>\n",
       "      <td>4.02</td>\n",
       "      <td>NaN</td>\n",
       "      <td>1407.27</td>\n",
       "      <td>26023.24</td>\n",
       "      <td>29245.77</td>\n",
       "      <td>-3222.53</td>\n",
       "      <td>-3233.26</td>\n",
       "      <td>-2116.07</td>\n",
       "      <td>NaN</td>\n",
       "      <td>51791.9</td>\n",
       "      <td>95199.4</td>\n",
       "      <td>170.037</td>\n",
       "      <td>76.7</td>\n",
       "      <td>1.439324e+09</td>\n",
       "      <td>153.0</td>\n",
       "      <td>38.0</td>\n",
       "      <td>61.0</td>\n",
       "      <td>NaN</td>\n",
       "      <td>1/26/2020</td>\n",
       "      <td>4.2</td>\n",
       "      <td>24.7</td>\n",
       "      <td>1.15</td>\n",
       "      <td>1.17</td>\n",
       "      <td>1.14</td>\n",
       "      <td>1.04</td>\n",
       "      <td>1.02</td>\n",
       "      <td>0.92</td>\n",
       "      <td>1.06</td>\n",
       "      <td>63.1</td>\n",
       "      <td>56.35</td>\n",
       "      <td>70.52</td>\n",
       "      <td>6360</td>\n",
       "      <td>1</td>\n",
       "      <td>99</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>6361</th>\n",
       "      <td>5582.0</td>\n",
       "      <td>Hubei</td>\n",
       "      <td>China</td>\n",
       "      <td>30.9756</td>\n",
       "      <td>112.2707</td>\n",
       "      <td>2020-01-23</td>\n",
       "      <td>444.0</td>\n",
       "      <td>17.0</td>\n",
       "      <td>NaN</td>\n",
       "      <td>China/Hubei</td>\n",
       "      <td>23</td>\n",
       "      <td>0.0</td>\n",
       "      <td>0.0</td>\n",
       "      <td>444.0</td>\n",
       "      <td>0.0</td>\n",
       "      <td>0.0</td>\n",
       "      <td>0.0</td>\n",
       "      <td>17.0</td>\n",
       "      <td>0.0</td>\n",
       "      <td>0.0</td>\n",
       "      <td>0.0</td>\n",
       "      <td>36</td>\n",
       "      <td>23</td>\n",
       "      <td>5</td>\n",
       "      <td>14</td>\n",
       "      <td>1</td>\n",
       "      <td>0</td>\n",
       "      <td>25.6</td>\n",
       "      <td>China</td>\n",
       "      <td>89473.25</td>\n",
       "      <td>95199.4</td>\n",
       "      <td>106.4</td>\n",
       "      <td>63579.45</td>\n",
       "      <td>67648.44</td>\n",
       "      <td>NaN</td>\n",
       "      <td>27272.31</td>\n",
       "      <td>19379.63</td>\n",
       "      <td>19.191</td>\n",
       "      <td>3.491</td>\n",
       "      <td>42.674</td>\n",
       "      <td>43.9</td>\n",
       "      <td>125.931</td>\n",
       "      <td>123.888</td>\n",
       "      <td>NaN</td>\n",
       "      <td>3.877</td>\n",
       "      <td>3.6</td>\n",
       "      <td>2.689</td>\n",
       "      <td>3.0</td>\n",
       "      <td>4.02</td>\n",
       "      <td>NaN</td>\n",
       "      <td>1407.27</td>\n",
       "      <td>26023.24</td>\n",
       "      <td>29245.77</td>\n",
       "      <td>-3222.53</td>\n",
       "      <td>-3233.26</td>\n",
       "      <td>-2116.07</td>\n",
       "      <td>NaN</td>\n",
       "      <td>51791.9</td>\n",
       "      <td>95199.4</td>\n",
       "      <td>170.037</td>\n",
       "      <td>76.7</td>\n",
       "      <td>1.439324e+09</td>\n",
       "      <td>153.0</td>\n",
       "      <td>38.0</td>\n",
       "      <td>61.0</td>\n",
       "      <td>NaN</td>\n",
       "      <td>1/26/2020</td>\n",
       "      <td>4.2</td>\n",
       "      <td>24.7</td>\n",
       "      <td>1.15</td>\n",
       "      <td>1.17</td>\n",
       "      <td>1.14</td>\n",
       "      <td>1.04</td>\n",
       "      <td>1.02</td>\n",
       "      <td>0.92</td>\n",
       "      <td>1.06</td>\n",
       "      <td>63.1</td>\n",
       "      <td>56.35</td>\n",
       "      <td>70.52</td>\n",
       "      <td>6361</td>\n",
       "      <td>1</td>\n",
       "      <td>99</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>6362</th>\n",
       "      <td>5583.0</td>\n",
       "      <td>Hubei</td>\n",
       "      <td>China</td>\n",
       "      <td>30.9756</td>\n",
       "      <td>112.2707</td>\n",
       "      <td>2020-01-24</td>\n",
       "      <td>549.0</td>\n",
       "      <td>24.0</td>\n",
       "      <td>NaN</td>\n",
       "      <td>China/Hubei</td>\n",
       "      <td>24</td>\n",
       "      <td>105.0</td>\n",
       "      <td>7.0</td>\n",
       "      <td>0.0</td>\n",
       "      <td>0.0</td>\n",
       "      <td>0.0</td>\n",
       "      <td>0.0</td>\n",
       "      <td>0.0</td>\n",
       "      <td>0.0</td>\n",
       "      <td>0.0</td>\n",
       "      <td>0.0</td>\n",
       "      <td>37</td>\n",
       "      <td>24</td>\n",
       "      <td>6</td>\n",
       "      <td>15</td>\n",
       "      <td>2</td>\n",
       "      <td>0</td>\n",
       "      <td>25.6</td>\n",
       "      <td>China</td>\n",
       "      <td>89473.25</td>\n",
       "      <td>95199.4</td>\n",
       "      <td>106.4</td>\n",
       "      <td>63579.45</td>\n",
       "      <td>67648.44</td>\n",
       "      <td>NaN</td>\n",
       "      <td>27272.31</td>\n",
       "      <td>19379.63</td>\n",
       "      <td>19.191</td>\n",
       "      <td>3.491</td>\n",
       "      <td>42.674</td>\n",
       "      <td>43.9</td>\n",
       "      <td>125.931</td>\n",
       "      <td>123.888</td>\n",
       "      <td>NaN</td>\n",
       "      <td>3.877</td>\n",
       "      <td>3.6</td>\n",
       "      <td>2.689</td>\n",
       "      <td>3.0</td>\n",
       "      <td>4.02</td>\n",
       "      <td>NaN</td>\n",
       "      <td>1407.27</td>\n",
       "      <td>26023.24</td>\n",
       "      <td>29245.77</td>\n",
       "      <td>-3222.53</td>\n",
       "      <td>-3233.26</td>\n",
       "      <td>-2116.07</td>\n",
       "      <td>NaN</td>\n",
       "      <td>51791.9</td>\n",
       "      <td>95199.4</td>\n",
       "      <td>170.037</td>\n",
       "      <td>76.7</td>\n",
       "      <td>1.439324e+09</td>\n",
       "      <td>153.0</td>\n",
       "      <td>38.0</td>\n",
       "      <td>61.0</td>\n",
       "      <td>NaN</td>\n",
       "      <td>1/26/2020</td>\n",
       "      <td>4.2</td>\n",
       "      <td>24.7</td>\n",
       "      <td>1.15</td>\n",
       "      <td>1.17</td>\n",
       "      <td>1.14</td>\n",
       "      <td>1.04</td>\n",
       "      <td>1.02</td>\n",
       "      <td>0.92</td>\n",
       "      <td>1.06</td>\n",
       "      <td>63.1</td>\n",
       "      <td>56.35</td>\n",
       "      <td>70.52</td>\n",
       "      <td>6362</td>\n",
       "      <td>1</td>\n",
       "      <td>99</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>6363</th>\n",
       "      <td>5584.0</td>\n",
       "      <td>Hubei</td>\n",
       "      <td>China</td>\n",
       "      <td>30.9756</td>\n",
       "      <td>112.2707</td>\n",
       "      <td>2020-01-25</td>\n",
       "      <td>761.0</td>\n",
       "      <td>40.0</td>\n",
       "      <td>NaN</td>\n",
       "      <td>China/Hubei</td>\n",
       "      <td>25</td>\n",
       "      <td>212.0</td>\n",
       "      <td>16.0</td>\n",
       "      <td>105.0</td>\n",
       "      <td>0.0</td>\n",
       "      <td>0.0</td>\n",
       "      <td>0.0</td>\n",
       "      <td>7.0</td>\n",
       "      <td>0.0</td>\n",
       "      <td>0.0</td>\n",
       "      <td>0.0</td>\n",
       "      <td>38</td>\n",
       "      <td>25</td>\n",
       "      <td>7</td>\n",
       "      <td>16</td>\n",
       "      <td>3</td>\n",
       "      <td>0</td>\n",
       "      <td>25.6</td>\n",
       "      <td>China</td>\n",
       "      <td>89473.25</td>\n",
       "      <td>95199.4</td>\n",
       "      <td>106.4</td>\n",
       "      <td>63579.45</td>\n",
       "      <td>67648.44</td>\n",
       "      <td>NaN</td>\n",
       "      <td>27272.31</td>\n",
       "      <td>19379.63</td>\n",
       "      <td>19.191</td>\n",
       "      <td>3.491</td>\n",
       "      <td>42.674</td>\n",
       "      <td>43.9</td>\n",
       "      <td>125.931</td>\n",
       "      <td>123.888</td>\n",
       "      <td>NaN</td>\n",
       "      <td>3.877</td>\n",
       "      <td>3.6</td>\n",
       "      <td>2.689</td>\n",
       "      <td>3.0</td>\n",
       "      <td>4.02</td>\n",
       "      <td>NaN</td>\n",
       "      <td>1407.27</td>\n",
       "      <td>26023.24</td>\n",
       "      <td>29245.77</td>\n",
       "      <td>-3222.53</td>\n",
       "      <td>-3233.26</td>\n",
       "      <td>-2116.07</td>\n",
       "      <td>NaN</td>\n",
       "      <td>51791.9</td>\n",
       "      <td>95199.4</td>\n",
       "      <td>170.037</td>\n",
       "      <td>76.7</td>\n",
       "      <td>1.439324e+09</td>\n",
       "      <td>153.0</td>\n",
       "      <td>38.0</td>\n",
       "      <td>61.0</td>\n",
       "      <td>NaN</td>\n",
       "      <td>1/26/2020</td>\n",
       "      <td>4.2</td>\n",
       "      <td>24.7</td>\n",
       "      <td>1.15</td>\n",
       "      <td>1.17</td>\n",
       "      <td>1.14</td>\n",
       "      <td>1.04</td>\n",
       "      <td>1.02</td>\n",
       "      <td>0.92</td>\n",
       "      <td>1.06</td>\n",
       "      <td>63.1</td>\n",
       "      <td>56.35</td>\n",
       "      <td>70.52</td>\n",
       "      <td>6363</td>\n",
       "      <td>1</td>\n",
       "      <td>99</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>6364</th>\n",
       "      <td>5585.0</td>\n",
       "      <td>Hubei</td>\n",
       "      <td>China</td>\n",
       "      <td>30.9756</td>\n",
       "      <td>112.2707</td>\n",
       "      <td>2020-01-26</td>\n",
       "      <td>1058.0</td>\n",
       "      <td>52.0</td>\n",
       "      <td>NaN</td>\n",
       "      <td>China/Hubei</td>\n",
       "      <td>26</td>\n",
       "      <td>297.0</td>\n",
       "      <td>12.0</td>\n",
       "      <td>212.0</td>\n",
       "      <td>0.0</td>\n",
       "      <td>0.0</td>\n",
       "      <td>0.0</td>\n",
       "      <td>16.0</td>\n",
       "      <td>0.0</td>\n",
       "      <td>0.0</td>\n",
       "      <td>0.0</td>\n",
       "      <td>39</td>\n",
       "      <td>26</td>\n",
       "      <td>8</td>\n",
       "      <td>17</td>\n",
       "      <td>4</td>\n",
       "      <td>0</td>\n",
       "      <td>25.6</td>\n",
       "      <td>China</td>\n",
       "      <td>89473.25</td>\n",
       "      <td>95199.4</td>\n",
       "      <td>106.4</td>\n",
       "      <td>63579.45</td>\n",
       "      <td>67648.44</td>\n",
       "      <td>NaN</td>\n",
       "      <td>27272.31</td>\n",
       "      <td>19379.63</td>\n",
       "      <td>19.191</td>\n",
       "      <td>3.491</td>\n",
       "      <td>42.674</td>\n",
       "      <td>43.9</td>\n",
       "      <td>125.931</td>\n",
       "      <td>123.888</td>\n",
       "      <td>NaN</td>\n",
       "      <td>3.877</td>\n",
       "      <td>3.6</td>\n",
       "      <td>2.689</td>\n",
       "      <td>3.0</td>\n",
       "      <td>4.02</td>\n",
       "      <td>NaN</td>\n",
       "      <td>1407.27</td>\n",
       "      <td>26023.24</td>\n",
       "      <td>29245.77</td>\n",
       "      <td>-3222.53</td>\n",
       "      <td>-3233.26</td>\n",
       "      <td>-2116.07</td>\n",
       "      <td>NaN</td>\n",
       "      <td>51791.9</td>\n",
       "      <td>95199.4</td>\n",
       "      <td>170.037</td>\n",
       "      <td>76.7</td>\n",
       "      <td>1.439324e+09</td>\n",
       "      <td>153.0</td>\n",
       "      <td>38.0</td>\n",
       "      <td>61.0</td>\n",
       "      <td>NaN</td>\n",
       "      <td>1/26/2020</td>\n",
       "      <td>4.2</td>\n",
       "      <td>24.7</td>\n",
       "      <td>1.15</td>\n",
       "      <td>1.17</td>\n",
       "      <td>1.14</td>\n",
       "      <td>1.04</td>\n",
       "      <td>1.02</td>\n",
       "      <td>0.92</td>\n",
       "      <td>1.06</td>\n",
       "      <td>63.1</td>\n",
       "      <td>56.35</td>\n",
       "      <td>70.52</td>\n",
       "      <td>6364</td>\n",
       "      <td>1</td>\n",
       "      <td>99</td>\n",
       "    </tr>\n",
       "  </tbody>\n",
       "</table>\n",
       "</div>"
      ],
      "text/plain": [
       "          Id Province/State Country/Region      Lat      Long       Date  \\\n",
       "6360  5581.0          Hubei          China  30.9756  112.2707 2020-01-22   \n",
       "6361  5582.0          Hubei          China  30.9756  112.2707 2020-01-23   \n",
       "6362  5583.0          Hubei          China  30.9756  112.2707 2020-01-24   \n",
       "6363  5584.0          Hubei          China  30.9756  112.2707 2020-01-25   \n",
       "6364  5585.0          Hubei          China  30.9756  112.2707 2020-01-26   \n",
       "\n",
       "      ConfirmedCases  Fatalities  ForecastId     place_id  day  cases/day  \\\n",
       "6360           444.0        17.0         NaN  China/Hubei   22      444.0   \n",
       "6361           444.0        17.0         NaN  China/Hubei   23        0.0   \n",
       "6362           549.0        24.0         NaN  China/Hubei   24      105.0   \n",
       "6363           761.0        40.0         NaN  China/Hubei   25      212.0   \n",
       "6364          1058.0        52.0         NaN  China/Hubei   26      297.0   \n",
       "\n",
       "      fatal/day  cases/day-(1-1)  cases/day-(1-7)  cases/day-(8-14)  \\\n",
       "6360       17.0              0.0              0.0               0.0   \n",
       "6361        0.0            444.0              0.0               0.0   \n",
       "6362        7.0              0.0              0.0               0.0   \n",
       "6363       16.0            105.0              0.0               0.0   \n",
       "6364       12.0            212.0              0.0               0.0   \n",
       "\n",
       "      cases/day-(15-21)  fatal/day-(1-1)  fatal/day-(1-7)  fatal/day-(8-14)  \\\n",
       "6360                0.0              0.0              0.0               0.0   \n",
       "6361                0.0             17.0              0.0               0.0   \n",
       "6362                0.0              0.0              0.0               0.0   \n",
       "6363                0.0              7.0              0.0               0.0   \n",
       "6364                0.0             16.0              0.0               0.0   \n",
       "\n",
       "      fatal/day-(15-21)  days_since_1cases  days_since_10cases  \\\n",
       "6360                0.0                 35                  22   \n",
       "6361                0.0                 36                  23   \n",
       "6362                0.0                 37                  24   \n",
       "6363                0.0                 38                  25   \n",
       "6364                0.0                 39                  26   \n",
       "\n",
       "      days_since_100cases  days_since_1fatal  days_since_10fatal  \\\n",
       "6360                    4                 13                   0   \n",
       "6361                    5                 14                   1   \n",
       "6362                    6                 15                   2   \n",
       "6363                    7                 16                   3   \n",
       "6364                    8                 17                   4   \n",
       "\n",
       "      days_since_100fatal  SmokingRate Country  \\\n",
       "6360                    0         25.6   China   \n",
       "6361                    0         25.6   China   \n",
       "6362                    0         25.6   China   \n",
       "6363                    0         25.6   China   \n",
       "6364                    0         25.6   China   \n",
       "\n",
       "      Gross_domestic_product__constant_prices  \\\n",
       "6360                                 89473.25   \n",
       "6361                                 89473.25   \n",
       "6362                                 89473.25   \n",
       "6363                                 89473.25   \n",
       "6364                                 89473.25   \n",
       "\n",
       "      Gross_domestic_product__current_prices  \\\n",
       "6360                                 95199.4   \n",
       "6361                                 95199.4   \n",
       "6362                                 95199.4   \n",
       "6363                                 95199.4   \n",
       "6364                                 95199.4   \n",
       "\n",
       "      Gross_domestic_product__deflator  \\\n",
       "6360                             106.4   \n",
       "6361                             106.4   \n",
       "6362                             106.4   \n",
       "6363                             106.4   \n",
       "6364                             106.4   \n",
       "\n",
       "      Gross_domestic_product_per_capita__constant_prices  \\\n",
       "6360                                           63579.45    \n",
       "6361                                           63579.45    \n",
       "6362                                           63579.45    \n",
       "6363                                           63579.45    \n",
       "6364                                           63579.45    \n",
       "\n",
       "      Gross_domestic_product_per_capita__current_prices  \\\n",
       "6360                                           67648.44   \n",
       "6361                                           67648.44   \n",
       "6362                                           67648.44   \n",
       "6363                                           67648.44   \n",
       "6364                                           67648.44   \n",
       "\n",
       "      Output_gap_in_percent_of_potential_GDP  \\\n",
       "6360                                     NaN   \n",
       "6361                                     NaN   \n",
       "6362                                     NaN   \n",
       "6363                                     NaN   \n",
       "6364                                     NaN   \n",
       "\n",
       "      Gross_domestic_product_based_on_purchasing_power_parity__PPP__valuation_of_country_GDP  \\\n",
       "6360                                           27272.31                                        \n",
       "6361                                           27272.31                                        \n",
       "6362                                           27272.31                                        \n",
       "6363                                           27272.31                                        \n",
       "6364                                           27272.31                                        \n",
       "\n",
       "      Gross_domestic_product_based_on_purchasing_power_parity__PPP__per_capita_GDP  \\\n",
       "6360                                           19379.63                              \n",
       "6361                                           19379.63                              \n",
       "6362                                           19379.63                              \n",
       "6363                                           19379.63                              \n",
       "6364                                           19379.63                              \n",
       "\n",
       "      Gross_domestic_product_based_on_purchasing_power_parity__PPP__share_of_world_total  \\\n",
       "6360                                             19.191                                    \n",
       "6361                                             19.191                                    \n",
       "6362                                             19.191                                    \n",
       "6363                                             19.191                                    \n",
       "6364                                             19.191                                    \n",
       "\n",
       "      Implied_PPP_conversion_rate  Total_investment  Gross_national_savings  \\\n",
       "6360                        3.491            42.674                    43.9   \n",
       "6361                        3.491            42.674                    43.9   \n",
       "6362                        3.491            42.674                    43.9   \n",
       "6363                        3.491            42.674                    43.9   \n",
       "6364                        3.491            42.674                    43.9   \n",
       "\n",
       "      Inflation__average_consumer_prices  \\\n",
       "6360                             125.931   \n",
       "6361                             125.931   \n",
       "6362                             125.931   \n",
       "6363                             125.931   \n",
       "6364                             125.931   \n",
       "\n",
       "      Inflation__end_of_period_consumer_prices  \\\n",
       "6360                                   123.888   \n",
       "6361                                   123.888   \n",
       "6362                                   123.888   \n",
       "6363                                   123.888   \n",
       "6364                                   123.888   \n",
       "\n",
       "      Six_month_London_interbank_offered_rate__LIBOR_  \\\n",
       "6360                                              NaN   \n",
       "6361                                              NaN   \n",
       "6362                                              NaN   \n",
       "6363                                              NaN   \n",
       "6364                                              NaN   \n",
       "\n",
       "      Volume_of_imports_of_goods_and_services  Volume_of_Imports_of_goods  \\\n",
       "6360                                    3.877                         3.6   \n",
       "6361                                    3.877                         3.6   \n",
       "6362                                    3.877                         3.6   \n",
       "6363                                    3.877                         3.6   \n",
       "6364                                    3.877                         3.6   \n",
       "\n",
       "      Volume_of_exports_of_goods_and_services  Volume_of_exports_of_goods  \\\n",
       "6360                                    2.689                         3.0   \n",
       "6361                                    2.689                         3.0   \n",
       "6362                                    2.689                         3.0   \n",
       "6363                                    2.689                         3.0   \n",
       "6364                                    2.689                         3.0   \n",
       "\n",
       "      Unemployment_rate  Employment  Population  General_government_revenue  \\\n",
       "6360               4.02         NaN     1407.27                    26023.24   \n",
       "6361               4.02         NaN     1407.27                    26023.24   \n",
       "6362               4.02         NaN     1407.27                    26023.24   \n",
       "6363               4.02         NaN     1407.27                    26023.24   \n",
       "6364               4.02         NaN     1407.27                    26023.24   \n",
       "\n",
       "      General_government_total_expenditure  \\\n",
       "6360                              29245.77   \n",
       "6361                              29245.77   \n",
       "6362                              29245.77   \n",
       "6363                              29245.77   \n",
       "6364                              29245.77   \n",
       "\n",
       "      General_government_net_lending_borrowing  \\\n",
       "6360                                  -3222.53   \n",
       "6361                                  -3222.53   \n",
       "6362                                  -3222.53   \n",
       "6363                                  -3222.53   \n",
       "6364                                  -3222.53   \n",
       "\n",
       "      General_government_structural_balance  \\\n",
       "6360                               -3233.26   \n",
       "6361                               -3233.26   \n",
       "6362                               -3233.26   \n",
       "6363                               -3233.26   \n",
       "6364                               -3233.26   \n",
       "\n",
       "      General_government_primary_net_lending_borrowing  \\\n",
       "6360                                          -2116.07   \n",
       "6361                                          -2116.07   \n",
       "6362                                          -2116.07   \n",
       "6363                                          -2116.07   \n",
       "6364                                          -2116.07   \n",
       "\n",
       "      General_government_net_debt  General_government_gross_debt  \\\n",
       "6360                          NaN                        51791.9   \n",
       "6361                          NaN                        51791.9   \n",
       "6362                          NaN                        51791.9   \n",
       "6363                          NaN                        51791.9   \n",
       "6364                          NaN                        51791.9   \n",
       "\n",
       "      Gross_domestic_product_corresponding_to_fiscal_year__current_prices  \\\n",
       "6360                                            95199.4                     \n",
       "6361                                            95199.4                     \n",
       "6362                                            95199.4                     \n",
       "6363                                            95199.4                     \n",
       "6364                                            95199.4                     \n",
       "\n",
       "      Current_account_balance  LifeExpectancy           pop  density  \\\n",
       "6360                  170.037            76.7  1.439324e+09    153.0   \n",
       "6361                  170.037            76.7  1.439324e+09    153.0   \n",
       "6362                  170.037            76.7  1.439324e+09    153.0   \n",
       "6363                  170.037            76.7  1.439324e+09    153.0   \n",
       "6364                  170.037            76.7  1.439324e+09    153.0   \n",
       "\n",
       "      medianage  urbanpop quarantine    schools  hospibed  smokers  sex0  \\\n",
       "6360       38.0      61.0        NaN  1/26/2020       4.2     24.7  1.15   \n",
       "6361       38.0      61.0        NaN  1/26/2020       4.2     24.7  1.15   \n",
       "6362       38.0      61.0        NaN  1/26/2020       4.2     24.7  1.15   \n",
       "6363       38.0      61.0        NaN  1/26/2020       4.2     24.7  1.15   \n",
       "6364       38.0      61.0        NaN  1/26/2020       4.2     24.7  1.15   \n",
       "\n",
       "      sex14  sex25  sex54  sex64  sex65plus  sexratio  lung  femalelung  \\\n",
       "6360   1.17   1.14   1.04   1.02       0.92      1.06  63.1       56.35   \n",
       "6361   1.17   1.14   1.04   1.02       0.92      1.06  63.1       56.35   \n",
       "6362   1.17   1.14   1.04   1.02       0.92      1.06  63.1       56.35   \n",
       "6363   1.17   1.14   1.04   1.02       0.92      1.06  63.1       56.35   \n",
       "6364   1.17   1.14   1.04   1.02       0.92      1.06  63.1       56.35   \n",
       "\n",
       "      malelung    id  Country/Region_le  Province/State_le  \n",
       "6360     70.52  6360                  1                 99  \n",
       "6361     70.52  6361                  1                 99  \n",
       "6362     70.52  6362                  1                 99  \n",
       "6363     70.52  6363                  1                 99  \n",
       "6364     70.52  6364                  1                 99  "
      ]
     },
     "execution_count": 89,
     "metadata": {},
     "output_type": "execute_result"
    }
   ],
   "source": [
    "df_traintest8[df_traintest8['place_id']=='China/Hubei'].head()"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 90,
   "metadata": {},
   "outputs": [],
   "source": [
    "df_traintest8.to_csv(\"final_data.csv\")"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 91,
   "metadata": {},
   "outputs": [],
   "source": [
    "#######################到这一步数据处理初步完成\n",
    "################首先得到一个模型的指标\n",
    "################metrics.mean_squared_error文档：https://scikit-learn.org/stable/modules/generated/sklearn.metrics.mean_squared_error.html#sklearn.metrics.mean_squared_error\n",
    "###############仔细讲解下面的函数：metric是sk中的一个指标类,mean_squared_error平均回归偏误\n",
    "###############numpy.clip函数控制预测的数据范围，可能模型抛出一个无穷大的值或负值，要截取预测值的上下限，\n",
    "from sklearn import metrics\n",
    "def calc_score(y_true, y_pred):\n",
    "    y_true[y_true<0] = 0\n",
    "    score = metrics.mean_squared_error(np.log(y_true.clip(0, 1e10)+1), np.log(y_pred[:]+1))**0.5\n",
    "    return score"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 92,
   "metadata": {},
   "outputs": [],
   "source": [
    "#################对死亡数据预测"
   ]
  },
  {
   "cell_type": "markdown",
   "metadata": {},
   "source": [
    "模型1：lightGBM "
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 82,
   "metadata": {},
   "outputs": [],
   "source": [
    "################对LightGBM的初步解释：\n",
    "#############LightGBM是一种决策树算法\n",
    "############是选择节点(leaf-wise)展开，展开收益最大的节点将会被展开，这存在一个防止过拟合的问题：叶子的节点样本数目太少，最大增益太少\n",
    "############在节点生长的划分方法上：和我们之前接触的决策树不一样，我们以前接触的节点分裂是根据每一个可供分裂的数值点带来的增益进行排序分裂，\n",
    "############GBM把一个区间的值作为一个桶进行分裂的候选项，这样当然更快，而且没有专注于某个具体的值，更好地防止过拟合"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 93,
   "metadata": {},
   "outputs": [],
   "source": [
    "import lightgbm as lgb       ############模型来了！！！！！！！！！！！！！！\n",
    "##################相关参数需要到API文档上找：https://lightgbm.readthedocs.io/en/latest/Parameters-Tuning.html\n",
    "##################lgb算法本质很好的说明文档：https://blog.csdn.net/weixin_39\n",
    "#7102/article/details/81912566?utm_medium=distribute.pc_relevant.none-task-blog-BlogCommendFromMachineLearnPai2-1.nonecase&depth_1-utm_source=distribute.pc_relevant.none-task-blog-BlogCommendFromMachineLearnPai2-1.nonecase\n",
    "##################老师上课说过的bagging算法,通过结合几个模型降低泛化误差的技术\n",
    "#################还是需要稍微阐述这个算法：\n",
    "#################几个很菜的模型，每个都很菜，但菜的地方各有不同，各有各的菜\n",
    "################但是因为各自菜的不一样，若联合起来，比如以投票的方式凑在一起预测，就能在菜的地方互相弥补变不菜了"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 94,
   "metadata": {},
   "outputs": [],
   "source": [
    "SEED = 42\n",
    "params = {'num_leaves': 8, ###########叶节点数目\n",
    "          'min_data_in_leaf': 5,  # 42, ################每个叶子最少的样本数：减少过拟合\n",
    "          'objective': 'regression',############目标：回归拟合\n",
    "          'max_depth': 8,  ###############深度限制防止过拟合\n",
    "          'learning_rate': 0.02,    ############学习速率\n",
    "          'boosting': 'gbdt',         #############梯度下降算法\n",
    "          'bagging_freq': 5,  # 5           ##########每迭代5次做一次重新取样\n",
    "          'bagging_fraction': 0.8,  # 0.5,  ############每次迭代重新取样的比例\n",
    "          'feature_fraction': 0.8201,      #########每次迭代选择键树的参数数目\n",
    "          'bagging_seed': SEED,       ###########随机种子数\n",
    "          'reg_alpha': 1,  # 1.728910519108444,       ############正则化项参数\n",
    "          'reg_lambda': 4.9847051755586085,     #############正则化部分参数\n",
    "          'random_state': SEED,     ##############我的理解是随机种子数\n",
    "          'metric': 'mse',      #############模型自我评价的指标:mse: mean squared error\n",
    "          'verbosity': 100,          ########实在不懂,显示训练资讯详细程度(0~3)，默认：1,就是最后训练结果的报告信息\n",
    "          'min_gain_to_split': 0.02,  # 0.01077313523861969,      ##############分裂的最小信息增益？？？应该也是防止过拟合\n",
    "          'min_child_weight': 5,  # 19.428902804238373,   ################叶节点样本权重小于此值，停止分列，防止过拟合\n",
    "          'num_threads': 6,         ############线程数目，与训练速度有关\n",
    "          }"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 85,
   "metadata": {},
   "outputs": [],
   "source": [
    "################光速训练出结果\n",
    "###############自由在特征中选定\n",
    "###############确诊人数建模,初步将所有变量都保留\n",
    "###############目标是死亡速率"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 95,
   "metadata": {},
   "outputs": [
    {
     "name": "stderr",
     "output_type": "stream",
     "text": [
      "F:\\Anaconda\\lib\\site-packages\\lightgbm\\basic.py:1243: UserWarning: Using categorical_feature in Dataset.\n",
      "  warnings.warn('Using categorical_feature in Dataset.')\n"
     ]
    },
    {
     "name": "stdout",
     "output_type": "stream",
     "text": [
      "Training until validation scores don't improve for 150 rounds\n",
      "[100]\ttraining's l2: 0.0127593\tvalid_1's l2: 0.102319\n",
      "[200]\ttraining's l2: 0.00804278\tvalid_1's l2: 0.153269\n",
      "Early stopping, best iteration is:\n",
      "[56]\ttraining's l2: 0.0195221\tvalid_1's l2: 0.0917462\n"
     ]
    }
   ],
   "source": [
    "# train model to predict fatalities/day\n",
    "col_target = 'fatal/day'\n",
    "col_var = [\n",
    "    'Lat', 'Long',                  #####保留经纬数据？\n",
    "    'days_since_1cases', \n",
    "    'days_since_10cases', \n",
    "    'days_since_100cases',\n",
    "    'days_since_1fatal', \n",
    "    'days_since_10fatal', 'days_since_100fatal',\n",
    " ################################下面是一组十分重要的变量，我认为他在拟合不同的传染阶段，人为调整爆发期\n",
    "    'cases/day-(1-1)',  ####################第一天的确诊人数\n",
    "    'cases/day-(1-7)',  ################从第七天开始统计的滚动确诊每日平均数目\n",
    "    'cases/day-(8-14)',   #################从第八天开始统计的滚动确诊每日平均数目\n",
    "    'cases/day-(15-21)',  ##################同理\n",
    "    'fatal/day-(1-1)', \n",
    "    'fatal/day-(1-7)',         #########同理\n",
    "    'fatal/day-(8-14)', \n",
    "    'fatal/day-(15-21)', \n",
    "    'SmokingRate',\n",
    "    'Gross_domestic_product__constant_prices',\n",
    "    'Gross_domestic_product__current_prices',\n",
    "    'Gross_domestic_product__deflator',\n",
    "    'Gross_domestic_product_per_capita__constant_prices',\n",
    "    'Gross_domestic_product_per_capita__current_prices',\n",
    "    'Output_gap_in_percent_of_potential_GDP',\n",
    "    'Gross_domestic_product_based_on_purchasing_power_parity__PPP__valuation_of_country_GDP',\n",
    "    'Gross_domestic_product_based_on_purchasing_power_parity__PPP__per_capita_GDP',\n",
    "    'Gross_domestic_product_based_on_purchasing_power_parity__PPP__share_of_world_total',\n",
    "    'Implied_PPP_conversion_rate', 'Total_investment',\n",
    "    'Gross_national_savings', 'Inflation__average_consumer_prices',\n",
    "    'Inflation__end_of_period_consumer_prices',\n",
    "    'Six_month_London_interbank_offered_rate__LIBOR_',\n",
    "    'Volume_of_imports_of_goods_and_services', 'Volume_of_Imports_of_goods',\n",
    "    'Volume_of_exports_of_goods_and_services', 'Volume_of_exports_of_goods',\n",
    "    'Unemployment_rate',                            ###############失业率\n",
    "    'Employment', 'Population',\n",
    "    'General_government_revenue', 'General_government_total_expenditure',\n",
    "    'General_government_net_lending_borrowing',\n",
    "    'General_government_structural_balance',\n",
    "    'General_government_primary_net_lending_borrowing',\n",
    "    'General_government_net_debt', 'General_government_gross_debt',\n",
    "    'Gross_domestic_product_corresponding_to_fiscal_year__current_prices',\n",
    "    'Current_account_balance', \n",
    "    'LifeExpectancy',\n",
    "    'pop',\n",
    "    'density', \n",
    "    'medianage', \n",
    "    'urbanpop', \n",
    "    'hospibed', 'smokers',\n",
    "]\n",
    "col_cat = []\n",
    "#####################当然是划分训练集和验证集\n",
    "#####################日期序号为61天前的数据作为训练集合\n",
    "#####################日期学号为61-72天的数据作为验证集合\n",
    "df_train = df_traintest8[(pd.isna(df_traintest8['ForecastId'])) & (df_traintest8['day']<61)]\n",
    "df_valid = df_traintest8[(pd.isna(df_traintest8['ForecastId'])) & (df_traintest8['day']>=61) & (df_traintest8['day']<72)]\n",
    "df_test = df_traintest8[pd.isna(df_traintest8['ForecastId'])==False]\n",
    "X_train = df_train[col_var]\n",
    "X_valid = df_valid[col_var]\n",
    "#######################为什么要取对数：取对数可以缩小特别大特别小的数据之间的差别，比如1和e10,相当于排除了特殊点？\n",
    "#######################最后得到的最佳参数肯定是不变的\n",
    "y_train = np.log(df_train[col_target].values.clip(0, 1e10)+1)\n",
    "y_valid = np.log(df_valid[col_target].values.clip(0, 1e10)+1)\n",
    "#######################lgb封装自身的训练集\n",
    "train_data = lgb.Dataset(X_train, label=y_train, categorical_feature=col_cat)\n",
    "valid_data = lgb.Dataset(X_valid, label=y_valid, categorical_feature=col_cat)\n",
    "num_round = 15000\n",
    "model = lgb.train(params, train_data, num_round, valid_sets=[train_data, valid_data],\n",
    "                  verbose_eval=100, ###########每100次输出一次评测结果\n",
    "                  early_stopping_rounds=150,)      #############如果连续150轮都无法优化，那么就提前停下\n",
    "\n",
    "best_itr = model.best_iteration"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 96,
   "metadata": {},
   "outputs": [
    {
     "name": "stdout",
     "output_type": "stream",
     "text": [
      "0.302896\n"
     ]
    }
   ],
   "source": [
    "y_true = df_valid['fatal/day'].values\n",
    "y_pred = np.exp(model.predict(X_valid))-1\n",
    "score = calc_score(y_true, y_pred)\n",
    "print(\"{:.6f}\".format(score))       ###################越大越差"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 66,
   "metadata": {},
   "outputs": [],
   "source": [
    "################喜闻乐见的特征重要性估计\n",
    "################如何去解释这个结果？\n",
    "#############排在前面几个都是我们拟合出来的趋势数据，人为的错开一星期，引入爆发期间隔观察对于之后疫情变化的影响\n",
    "#############选择截取保留前面10个重要性较为显著的数据\n",
    "############时间越长，死的人越多，时长与死亡人数天生具有相关性，如果本来每个解释变量对于因变量的解释性就不强\n",
    "############一昧地根据重要性筛选因变量地模型解释性不好"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 97,
   "metadata": {},
   "outputs": [
    {
     "data": {
      "text/html": [
       "<div>\n",
       "<style scoped>\n",
       "    .dataframe tbody tr th:only-of-type {\n",
       "        vertical-align: middle;\n",
       "    }\n",
       "\n",
       "    .dataframe tbody tr th {\n",
       "        vertical-align: top;\n",
       "    }\n",
       "\n",
       "    .dataframe thead th {\n",
       "        text-align: right;\n",
       "    }\n",
       "</style>\n",
       "<table border=\"1\" class=\"dataframe\">\n",
       "  <thead>\n",
       "    <tr style=\"text-align: right;\">\n",
       "      <th></th>\n",
       "      <th>feature</th>\n",
       "      <th>importance</th>\n",
       "    </tr>\n",
       "  </thead>\n",
       "  <tbody>\n",
       "    <tr>\n",
       "      <th>5</th>\n",
       "      <td>days_since_1fatal</td>\n",
       "      <td>52</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>6</th>\n",
       "      <td>days_since_10fatal</td>\n",
       "      <td>41</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>3</th>\n",
       "      <td>days_since_10cases</td>\n",
       "      <td>39</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>13</th>\n",
       "      <td>fatal/day-(1-7)</td>\n",
       "      <td>38</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>10</th>\n",
       "      <td>cases/day-(8-14)</td>\n",
       "      <td>36</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>2</th>\n",
       "      <td>days_since_1cases</td>\n",
       "      <td>31</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>8</th>\n",
       "      <td>cases/day-(1-1)</td>\n",
       "      <td>29</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>9</th>\n",
       "      <td>cases/day-(1-7)</td>\n",
       "      <td>26</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>4</th>\n",
       "      <td>days_since_100cases</td>\n",
       "      <td>25</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>12</th>\n",
       "      <td>fatal/day-(1-1)</td>\n",
       "      <td>17</td>\n",
       "    </tr>\n",
       "  </tbody>\n",
       "</table>\n",
       "</div>"
      ],
      "text/plain": [
       "                feature  importance\n",
       "5     days_since_1fatal          52\n",
       "6    days_since_10fatal          41\n",
       "3    days_since_10cases          39\n",
       "13      fatal/day-(1-7)          38\n",
       "10     cases/day-(8-14)          36\n",
       "2     days_since_1cases          31\n",
       "8       cases/day-(1-1)          29\n",
       "9       cases/day-(1-7)          26\n",
       "4   days_since_100cases          25\n",
       "12      fatal/day-(1-1)          17"
      ]
     },
     "execution_count": 97,
     "metadata": {},
     "output_type": "execute_result"
    }
   ],
   "source": [
    "tmp = pd.DataFrame()\n",
    "tmp[\"feature\"] = col_var\n",
    "tmp[\"importance\"] = model.feature_importance()\n",
    "tmp = tmp.sort_values('importance', ascending=False)\n",
    "tmp[:10]"
   ]
  },
  {
   "cell_type": "markdown",
   "metadata": {},
   "source": [
    "第二次选参"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 90,
   "metadata": {},
   "outputs": [],
   "source": [
    "####################去除掉没有解释力度，不重要的因变量"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 98,
   "metadata": {},
   "outputs": [],
   "source": [
    "col_var = [\n",
    "#     'Lat', 'Long',                  #####保留经纬数据？\n",
    "    'days_since_1cases', \n",
    "    'days_since_10cases', \n",
    "    'days_since_100cases',\n",
    "    'days_since_1fatal', \n",
    "    'days_since_10fatal', \n",
    "#     'days_since_100fatal',\n",
    "#  ################################下面是一组十分重要的变量，拟合不同的传染阶段，人为调整爆发期\n",
    "    'cases/day-(1-1)',  ####################第一天的确诊人数\n",
    "    'cases/day-(1-7)',  ################从第七天开始统计的滚动确诊每日平均数目\n",
    "    'cases/day-(8-14)',   #################从第八天开始统计的滚动确诊每日平均数目\n",
    "#     'cases/day-(15-21)',  ##################同理\n",
    "    'fatal/day-(1-1)', \n",
    "    'fatal/day-(1-7)',         #########同理\n",
    "]"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 99,
   "metadata": {},
   "outputs": [
    {
     "name": "stderr",
     "output_type": "stream",
     "text": [
      "F:\\Anaconda\\lib\\site-packages\\lightgbm\\basic.py:1243: UserWarning: Using categorical_feature in Dataset.\n",
      "  warnings.warn('Using categorical_feature in Dataset.')\n"
     ]
    },
    {
     "name": "stdout",
     "output_type": "stream",
     "text": [
      "Training until validation scores don't improve for 150 rounds\n",
      "[100]\ttraining's l2: 0.012765\tvalid_1's l2: 0.0882745\n",
      "[200]\ttraining's l2: 0.00808033\tvalid_1's l2: 0.114162\n",
      "Early stopping, best iteration is:\n",
      "[75]\ttraining's l2: 0.0156237\tvalid_1's l2: 0.0841545\n"
     ]
    }
   ],
   "source": [
    "col_cat = []\n",
    "#####################当然是划分训练集和验证集\n",
    "#####################日期序号为61天前的数据作为训练集合\n",
    "#####################日期学号为61-72天的数据作为验证集合\n",
    "df_train = df_traintest8[(pd.isna(df_traintest8['ForecastId'])) & (df_traintest8['day']<61)]\n",
    "df_valid = df_traintest8[(pd.isna(df_traintest8['ForecastId'])) & (df_traintest8['day']>=61) & (df_traintest8['day']<72)]\n",
    "df_test = df_traintest8[pd.isna(df_traintest8['ForecastId'])==False]\n",
    "X_train = df_train[col_var]\n",
    "X_valid = df_valid[col_var]\n",
    "#######################为什么要取对数：取对数可以缩小特别大特别小的数据之间的差别，比如1和e10,相当于排除了特殊点？\n",
    "#######################最后得到的最佳参数肯定是不变的\n",
    "y_train = np.log(df_train[col_target].values.clip(0, 1e10)+1)\n",
    "y_valid = np.log(df_valid[col_target].values.clip(0, 1e10)+1)\n",
    "#######################lgb封装自身的训练集\n",
    "train_data = lgb.Dataset(X_train, label=y_train, categorical_feature=col_cat)\n",
    "valid_data = lgb.Dataset(X_valid, label=y_valid, categorical_feature=col_cat)\n",
    "num_round = 15000\n",
    "model = lgb.train(params, train_data, num_round, \n",
    "                  valid_sets=[train_data, valid_data],\n",
    "                  verbose_eval=100, ###########每100次输出一次评测结果\n",
    "                  early_stopping_rounds=150,)      #############如果连续150轮都无法优化，那么就提前停下\n",
    "\n",
    "best_itr = model.best_iteration"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 100,
   "metadata": {},
   "outputs": [
    {
     "data": {
      "text/html": [
       "<div>\n",
       "<style scoped>\n",
       "    .dataframe tbody tr th:only-of-type {\n",
       "        vertical-align: middle;\n",
       "    }\n",
       "\n",
       "    .dataframe tbody tr th {\n",
       "        vertical-align: top;\n",
       "    }\n",
       "\n",
       "    .dataframe thead th {\n",
       "        text-align: right;\n",
       "    }\n",
       "</style>\n",
       "<table border=\"1\" class=\"dataframe\">\n",
       "  <thead>\n",
       "    <tr style=\"text-align: right;\">\n",
       "      <th></th>\n",
       "      <th>feature</th>\n",
       "      <th>importance</th>\n",
       "    </tr>\n",
       "  </thead>\n",
       "  <tbody>\n",
       "    <tr>\n",
       "      <th>3</th>\n",
       "      <td>days_since_1fatal</td>\n",
       "      <td>84</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>7</th>\n",
       "      <td>cases/day-(8-14)</td>\n",
       "      <td>66</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>5</th>\n",
       "      <td>cases/day-(1-1)</td>\n",
       "      <td>61</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>4</th>\n",
       "      <td>days_since_10fatal</td>\n",
       "      <td>58</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>1</th>\n",
       "      <td>days_since_10cases</td>\n",
       "      <td>56</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>9</th>\n",
       "      <td>fatal/day-(1-7)</td>\n",
       "      <td>56</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>6</th>\n",
       "      <td>cases/day-(1-7)</td>\n",
       "      <td>43</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>0</th>\n",
       "      <td>days_since_1cases</td>\n",
       "      <td>37</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>2</th>\n",
       "      <td>days_since_100cases</td>\n",
       "      <td>34</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>8</th>\n",
       "      <td>fatal/day-(1-1)</td>\n",
       "      <td>30</td>\n",
       "    </tr>\n",
       "  </tbody>\n",
       "</table>\n",
       "</div>"
      ],
      "text/plain": [
       "               feature  importance\n",
       "3    days_since_1fatal          84\n",
       "7     cases/day-(8-14)          66\n",
       "5      cases/day-(1-1)          61\n",
       "4   days_since_10fatal          58\n",
       "1   days_since_10cases          56\n",
       "9      fatal/day-(1-7)          56\n",
       "6      cases/day-(1-7)          43\n",
       "0    days_since_1cases          37\n",
       "2  days_since_100cases          34\n",
       "8      fatal/day-(1-1)          30"
      ]
     },
     "execution_count": 100,
     "metadata": {},
     "output_type": "execute_result"
    }
   ],
   "source": [
    "tmp = pd.DataFrame()\n",
    "tmp[\"feature\"] = col_var\n",
    "tmp[\"importance\"] = model.feature_importance()\n",
    "tmp = tmp.sort_values('importance', ascending=False)\n",
    "tmp[:10]"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 101,
   "metadata": {},
   "outputs": [
    {
     "name": "stdout",
     "output_type": "stream",
     "text": [
      "0.290094\n"
     ]
    }
   ],
   "source": [
    "y_true = df_valid['fatal/day'].values\n",
    "y_pred = np.exp(model.predict(X_valid))-1\n",
    "score = calc_score(y_true, y_pred)\n",
    "print(\"{:.6f}\".format(score)) ####################只是好了一点点，这代表前面几个变量是解释的因变量中主力军"
   ]
  },
  {
   "cell_type": "markdown",
   "metadata": {},
   "source": [
    "第三次选参"
   ]
  },
  {
   "cell_type": "markdown",
   "metadata": {},
   "source": [
    "测试趋势数据"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 102,
   "metadata": {},
   "outputs": [],
   "source": [
    "############需要反思：效果并不好\n",
    "############重要性排在前面的因变量主要可以分为两类：\n",
    "############一类是时间长度数据\n",
    "############一类是时间趋势数据\n",
    "############分开两个部分各自测试"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 103,
   "metadata": {},
   "outputs": [],
   "source": [
    "col_var = [\n",
    "#     'Lat', 'Long',                  #####保留经纬数据？\n",
    "#     'days_since_1cases', \n",
    "#     'days_since_10cases', \n",
    "#     'days_since_100cases',\n",
    "#     'days_since_1fatal', \n",
    "#     'days_since_10fatal', \n",
    "#     'days_since_100fatal',\n",
    "#  ################################下面是一组十分重要的变量，我认为他在拟合不同的传染阶段，人为调整爆发期\n",
    "    'cases/day-(1-1)',  ####################第一天的确诊人数\n",
    "    'cases/day-(1-7)',  ################从第七天开始统计的滚动确诊每日平均数目\n",
    "    'cases/day-(8-14)',   #################从第八天开始统计的滚动确诊每日平均数目\n",
    "    'cases/day-(15-21)',  ##################同理\n",
    "    'fatal/day-(1-1)', \n",
    "    'fatal/day-(1-7)',         #########同理保留了所有的趋势数据\n",
    "    'fatal/day-(8-14)', \n",
    "    'fatal/day-(15-21)', \n",
    "]"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 104,
   "metadata": {},
   "outputs": [
    {
     "name": "stderr",
     "output_type": "stream",
     "text": [
      "F:\\Anaconda\\lib\\site-packages\\lightgbm\\basic.py:1243: UserWarning: Using categorical_feature in Dataset.\n",
      "  warnings.warn('Using categorical_feature in Dataset.')\n"
     ]
    },
    {
     "name": "stdout",
     "output_type": "stream",
     "text": [
      "Training until validation scores don't improve for 150 rounds\n",
      "[100]\ttraining's l2: 0.0142976\tvalid_1's l2: 0.0370896\n",
      "[200]\ttraining's l2: 0.00942451\tvalid_1's l2: 0.0343852\n",
      "[300]\ttraining's l2: 0.00791817\tvalid_1's l2: 0.0369217\n",
      "Early stopping, best iteration is:\n",
      "[180]\ttraining's l2: 0.010034\tvalid_1's l2: 0.0339252\n"
     ]
    }
   ],
   "source": [
    "col_cat = []\n",
    "#####################当然是划分训练集和验证集\n",
    "#####################日期序号为61天前的数据作为训练集合\n",
    "#####################日期学号为61-72天的数据作为验证集合\n",
    "df_train = df_traintest8[(pd.isna(df_traintest8['ForecastId'])) & (df_traintest8['day']<61)]\n",
    "df_valid = df_traintest8[(pd.isna(df_traintest8['ForecastId'])) & (df_traintest8['day']>=61) & (df_traintest8['day']<72)]\n",
    "df_test = df_traintest8[pd.isna(df_traintest8['ForecastId'])==False]\n",
    "X_train = df_train[col_var]\n",
    "X_valid = df_valid[col_var]\n",
    "#######################为什么要取对数：取对数可以缩小特别大特别小的数据之间的差别，比如1和e10,相当于排除了特殊点？\n",
    "#######################最后得到的最佳参数肯定是不变的\n",
    "y_train = np.log(df_train[col_target].values.clip(0, 1e10)+1)\n",
    "y_valid = np.log(df_valid[col_target].values.clip(0, 1e10)+1)\n",
    "#######################lgb封装自身的训练集\n",
    "train_data = lgb.Dataset(X_train, label=y_train, categorical_feature=col_cat)\n",
    "valid_data = lgb.Dataset(X_valid, label=y_valid, categorical_feature=col_cat)\n",
    "num_round = 15000\n",
    "model = lgb.train(params, train_data, num_round, valid_sets=[train_data, valid_data],\n",
    "                  verbose_eval=100, ###########每100次输出一次评测结果\n",
    "                  early_stopping_rounds=150,)      #############如果连续150轮都无法优化，那么就提前停下\n",
    "\n",
    "best_itr = model.best_iteration"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 105,
   "metadata": {},
   "outputs": [
    {
     "name": "stdout",
     "output_type": "stream",
     "text": [
      "0.184188\n"
     ]
    }
   ],
   "source": [
    "y_true = df_valid['fatal/day'].values\n",
    "y_pred = np.exp(model.predict(X_valid))-1\n",
    "score = calc_score(y_true, y_pred)\n",
    "print(\"{:.6f}\".format(score)) ####################变得好很多,继续引入更加多的参数"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 106,
   "metadata": {},
   "outputs": [],
   "source": [
    "#########测试时长数据"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 107,
   "metadata": {},
   "outputs": [],
   "source": [
    "col_var = [\n",
    "#     'Lat', 'Long',                  #####保留经纬数据？\n",
    "    'days_since_1cases', \n",
    "    'days_since_10cases', \n",
    "    'days_since_100cases',\n",
    "    'days_since_1fatal', \n",
    "    'days_since_10fatal', \n",
    "    'days_since_100fatal',\n",
    "#  ################################下面是一组十分重要的变量，我认为他在拟合不同的传染阶段，人为调整爆发期\n",
    "#     'cases/day-(1-1)',  ####################第一天的确诊人数\n",
    "#     'cases/day-(1-7)',  ################从第七天开始统计的滚动确诊每日平均数目\n",
    "#     'cases/day-(8-14)',   #################从第八天开始统计的滚动确诊每日平均数目\n",
    "#     'cases/day-(15-21)',  ##################同理\n",
    "#     'fatal/day-(1-1)', \n",
    "#     'fatal/day-(1-7)',         #########同理保留了所有的趋势数据\n",
    "#     'fatal/day-(8-14)', \n",
    "#     'fatal/day-(15-21)', \n",
    "]"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 108,
   "metadata": {},
   "outputs": [
    {
     "name": "stderr",
     "output_type": "stream",
     "text": [
      "F:\\Anaconda\\lib\\site-packages\\lightgbm\\basic.py:1243: UserWarning: Using categorical_feature in Dataset.\n",
      "  warnings.warn('Using categorical_feature in Dataset.')\n"
     ]
    },
    {
     "name": "stdout",
     "output_type": "stream",
     "text": [
      "Training until validation scores don't improve for 150 rounds\n",
      "[100]\ttraining's l2: 0.0134678\tvalid_1's l2: 0.0858469\n",
      "[200]\ttraining's l2: 0.0103947\tvalid_1's l2: 0.101542\n",
      "Early stopping, best iteration is:\n",
      "[80]\ttraining's l2: 0.0153773\tvalid_1's l2: 0.0801523\n"
     ]
    }
   ],
   "source": [
    "col_cat = []\n",
    "#####################当然是划分训练集和验证集\n",
    "#####################日期序号为61天前的数据作为训练集合\n",
    "#####################日期学号为61-72天的数据作为验证集合\n",
    "df_train = df_traintest8[(pd.isna(df_traintest8['ForecastId'])) & (df_traintest8['day']<61)]\n",
    "df_valid = df_traintest8[(pd.isna(df_traintest8['ForecastId'])) & (df_traintest8['day']>=61) & (df_traintest8['day']<72)]\n",
    "df_test = df_traintest8[pd.isna(df_traintest8['ForecastId'])==False]\n",
    "X_train = df_train[col_var]\n",
    "X_valid = df_valid[col_var]\n",
    "#######################为什么要取对数：取对数可以缩小特别大特别小的数据之间的差别，比如1和e10,相当于排除了特殊点？\n",
    "#######################最后得到的最佳参数肯定是不变的\n",
    "y_train = np.log(df_train[col_target].values.clip(0, 1e10)+1)\n",
    "y_valid = np.log(df_valid[col_target].values.clip(0, 1e10)+1)\n",
    "#######################lgb封装自身的训练集\n",
    "train_data = lgb.Dataset(X_train, label=y_train, categorical_feature=col_cat)\n",
    "valid_data = lgb.Dataset(X_valid, label=y_valid, categorical_feature=col_cat)\n",
    "num_round = 15000\n",
    "model = lgb.train(params, train_data, num_round, valid_sets=[train_data, valid_data],\n",
    "                  verbose_eval=100, ###########每100次输出一次评测结果\n",
    "                  early_stopping_rounds=150,)      #############如果连续150轮都无法优化，那么就提前停下\n",
    "\n",
    "best_itr = model.best_iteration"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 109,
   "metadata": {},
   "outputs": [
    {
     "name": "stdout",
     "output_type": "stream",
     "text": [
      "0.283112\n"
     ]
    }
   ],
   "source": [
    "y_true = df_valid['fatal/day'].values\n",
    "y_pred = np.exp(model.predict(X_valid))-1\n",
    "score = calc_score(y_true, y_pred)\n",
    "print(\"{:.6f}\".format(score)) ####################变得好很多,继续引入更加多的参数"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 110,
   "metadata": {},
   "outputs": [],
   "source": [
    "##########################讨论：\n",
    "###########两大组因变量各自都不错放在一起情况就不好了\n",
    "##########这是为什么？因变量太多过拟合？\n",
    "##########只能留下来较好的趋势数据"
   ]
  },
  {
   "cell_type": "markdown",
   "metadata": {},
   "source": [
    "第四次选参,在去除时长数据，保留趋势数据的基础上引入环境变量数据,如果只是预测死亡数据,我们是不是应该减少确诊人数这个数据项？"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 111,
   "metadata": {},
   "outputs": [],
   "source": [
    "col_var = [\n",
    "#     'Lat', 'Long',                  #####需要保留经纬数据吗，经度纬度可能影响气候？\n",
    "#  ################################下面是一组十分重要的变量，我认为他在拟合不同的传染阶段，人为调整爆发期\n",
    "    'cases/day-(1-1)',  ####################第一天的确诊人数\n",
    "    'cases/day-(1-7)',  ################从第七天开始统计的滚动确诊每日平均数目\n",
    "    'cases/day-(8-14)',   #################从第八天开始统计的滚动确诊每日平均数目\n",
    "    'cases/day-(15-21)',  ##################同理\n",
    "    'fatal/day-(1-1)', \n",
    "    'fatal/day-(1-7)',         #########同理\n",
    "     'SmokingRate',\n",
    "    'Gross_domestic_product__constant_prices',\n",
    "    'LifeExpectancy',\n",
    "    'pop',\n",
    "    'density', \n",
    "    'medianage', \n",
    "    'urbanpop', \n",
    "    'hospibed', 'smokers'\n",
    "]"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 112,
   "metadata": {},
   "outputs": [
    {
     "name": "stderr",
     "output_type": "stream",
     "text": [
      "F:\\Anaconda\\lib\\site-packages\\lightgbm\\basic.py:1243: UserWarning: Using categorical_feature in Dataset.\n",
      "  warnings.warn('Using categorical_feature in Dataset.')\n"
     ]
    },
    {
     "name": "stdout",
     "output_type": "stream",
     "text": [
      "Training until validation scores don't improve for 150 rounds\n",
      "[100]\ttraining's l2: 0.0143356\tvalid_1's l2: 0.0374247\n",
      "[200]\ttraining's l2: 0.00950914\tvalid_1's l2: 0.0348293\n",
      "[300]\ttraining's l2: 0.00801161\tvalid_1's l2: 0.0368191\n",
      "Early stopping, best iteration is:\n",
      "[180]\ttraining's l2: 0.0100894\tvalid_1's l2: 0.0341967\n"
     ]
    }
   ],
   "source": [
    "col_cat = []\n",
    "#####################当然是划分训练集和验证集\n",
    "#####################日期序号为61天前的数据作为训练集合\n",
    "#####################日期学号为61-72天的数据作为验证集合\n",
    "df_train = df_traintest8[(pd.isna(df_traintest8['ForecastId'])) & (df_traintest8['day']<61)]\n",
    "df_valid = df_traintest8[(pd.isna(df_traintest8['ForecastId'])) & (df_traintest8['day']>=61) & (df_traintest8['day']<72)]\n",
    "df_test = df_traintest8[pd.isna(df_traintest8['ForecastId'])==False]\n",
    "X_train = df_train[col_var]\n",
    "X_valid = df_valid[col_var]\n",
    "#######################为什么要取对数：取对数可以缩小特别大特别小的数据之间的差别，比如1和e10,相当于排除了特殊点？\n",
    "#######################最后得到的最佳参数肯定是不变的\n",
    "y_train = np.log(df_train[col_target].values.clip(0, 1e10)+1)\n",
    "y_valid = np.log(df_valid[col_target].values.clip(0, 1e10)+1)\n",
    "#######################lgb封装自身的训练集\n",
    "train_data = lgb.Dataset(X_train, label=y_train, categorical_feature=col_cat)\n",
    "valid_data = lgb.Dataset(X_valid, label=y_valid, categorical_feature=col_cat)\n",
    "num_round = 15000\n",
    "model = lgb.train(params, train_data, num_round, valid_sets=[train_data, valid_data],\n",
    "                  verbose_eval=100, ###########每100次输出一次评测结果\n",
    "                  early_stopping_rounds=150,)      #############如果连续150轮都无法优化，那么就提前停下\n",
    "\n",
    "best_itr = model.best_iteration"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 113,
   "metadata": {},
   "outputs": [
    {
     "name": "stdout",
     "output_type": "stream",
     "text": [
      "0.184924\n"
     ]
    }
   ],
   "source": [
    "y_true = df_valid['fatal/day'].values\n",
    "##################记住之前加了一个1\n",
    "y_pred = np.exp(model.predict(X_valid))-1\n",
    "score = calc_score(y_true, y_pred)\n",
    "print(\"{:.6f}\".format(score)) ####################难受，更差了"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 114,
   "metadata": {},
   "outputs": [
    {
     "data": {
      "text/html": [
       "<div>\n",
       "<style scoped>\n",
       "    .dataframe tbody tr th:only-of-type {\n",
       "        vertical-align: middle;\n",
       "    }\n",
       "\n",
       "    .dataframe tbody tr th {\n",
       "        vertical-align: top;\n",
       "    }\n",
       "\n",
       "    .dataframe thead th {\n",
       "        text-align: right;\n",
       "    }\n",
       "</style>\n",
       "<table border=\"1\" class=\"dataframe\">\n",
       "  <thead>\n",
       "    <tr style=\"text-align: right;\">\n",
       "      <th></th>\n",
       "      <th>feature</th>\n",
       "      <th>importance</th>\n",
       "    </tr>\n",
       "  </thead>\n",
       "  <tbody>\n",
       "    <tr>\n",
       "      <th>1</th>\n",
       "      <td>cases/day-(1-7)</td>\n",
       "      <td>272</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>5</th>\n",
       "      <td>fatal/day-(1-7)</td>\n",
       "      <td>245</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>0</th>\n",
       "      <td>cases/day-(1-1)</td>\n",
       "      <td>184</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>2</th>\n",
       "      <td>cases/day-(8-14)</td>\n",
       "      <td>183</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>4</th>\n",
       "      <td>fatal/day-(1-1)</td>\n",
       "      <td>177</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>3</th>\n",
       "      <td>cases/day-(15-21)</td>\n",
       "      <td>102</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>9</th>\n",
       "      <td>pop</td>\n",
       "      <td>28</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>11</th>\n",
       "      <td>medianage</td>\n",
       "      <td>23</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>7</th>\n",
       "      <td>Gross_domestic_product__constant_prices</td>\n",
       "      <td>17</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>14</th>\n",
       "      <td>smokers</td>\n",
       "      <td>14</td>\n",
       "    </tr>\n",
       "  </tbody>\n",
       "</table>\n",
       "</div>"
      ],
      "text/plain": [
       "                                    feature  importance\n",
       "1                           cases/day-(1-7)         272\n",
       "5                           fatal/day-(1-7)         245\n",
       "0                           cases/day-(1-1)         184\n",
       "2                          cases/day-(8-14)         183\n",
       "4                           fatal/day-(1-1)         177\n",
       "3                         cases/day-(15-21)         102\n",
       "9                                       pop          28\n",
       "11                                medianage          23\n",
       "7   Gross_domestic_product__constant_prices          17\n",
       "14                                  smokers          14"
      ]
     },
     "execution_count": 114,
     "metadata": {},
     "output_type": "execute_result"
    }
   ],
   "source": [
    "tmp = pd.DataFrame()\n",
    "tmp[\"feature\"] = col_var\n",
    "tmp[\"importance\"] = model.feature_importance()\n",
    "tmp = tmp.sort_values('importance', ascending=False)\n",
    "tmp[:10]"
   ]
  },
  {
   "cell_type": "markdown",
   "metadata": {},
   "source": [
    "最后一次选择参数"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 115,
   "metadata": {},
   "outputs": [],
   "source": [
    "col_var = [\n",
    "    'Lat', 'Long',                  #####需要保留经纬数据吗，经度纬度可能影响气候？试一下\n",
    "#  ################################下面是一组十分重要的变量，我认为他在拟合不同的传染阶段，人为调整爆发期\n",
    "    'cases/day-(1-1)',  ####################第一天的确诊人数\n",
    "    'cases/day-(1-7)',  ################从第七天开始统计的滚动确诊每日平均数目\n",
    "#     'cases/day-(8-14)',   #################从第八天开始统计的滚动确诊每日平均数目\n",
    "#     'cases/day-(15-21)',##################去掉这个最差劲的趋势数据，试一下结果会不会好一点，太长的周期可能不会起作用，换为致命的15-21滚动\n",
    "   'fatal/day-(1-7)',\n",
    "    'fatal/day-(8-14)', \n",
    "    'fatal/day-(15-21)',         #########同理\n",
    "     'SmokingRate',\n",
    "     'density', \n",
    "]"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 116,
   "metadata": {},
   "outputs": [
    {
     "name": "stderr",
     "output_type": "stream",
     "text": [
      "F:\\Anaconda\\lib\\site-packages\\lightgbm\\basic.py:1243: UserWarning: Using categorical_feature in Dataset.\n",
      "  warnings.warn('Using categorical_feature in Dataset.')\n"
     ]
    },
    {
     "name": "stdout",
     "output_type": "stream",
     "text": [
      "Training until validation scores don't improve for 150 rounds\n",
      "[100]\ttraining's l2: 0.0146119\tvalid_1's l2: 0.0377734\n",
      "[200]\ttraining's l2: 0.00999437\tvalid_1's l2: 0.0351832\n",
      "[300]\ttraining's l2: 0.00845074\tvalid_1's l2: 0.0369364\n",
      "Early stopping, best iteration is:\n",
      "[178]\ttraining's l2: 0.0106467\tvalid_1's l2: 0.0344871\n"
     ]
    }
   ],
   "source": [
    "col_cat = []\n",
    "df_train = df_traintest8[(pd.isna(df_traintest8['ForecastId'])) & (df_traintest8['day']<61)]\n",
    "df_valid = df_traintest8[(pd.isna(df_traintest8['ForecastId'])) & (df_traintest8['day']>=61) & (df_traintest8['day']<72)]\n",
    "df_test = df_traintest8[pd.isna(df_traintest8['ForecastId'])==False]\n",
    "X_train = df_train[col_var]\n",
    "X_valid = df_valid[col_var]\n",
    "y_train = np.log(df_train[col_target].values.clip(0, 1e10)+1)\n",
    "y_valid = np.log(df_valid[col_target].values.clip(0, 1e10)+1)\n",
    "train_data = lgb.Dataset(X_train, label=y_train, categorical_feature=col_cat)\n",
    "valid_data = lgb.Dataset(X_valid, label=y_valid, categorical_feature=col_cat)\n",
    "num_round = 15000\n",
    "model = lgb.train(params, train_data, num_round, valid_sets=[train_data, valid_data],\n",
    "                  verbose_eval=100,\n",
    "                  early_stopping_rounds=150,)\n",
    "\n",
    "best_itr = model.best_iteration"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 156,
   "metadata": {},
   "outputs": [
    {
     "name": "stdout",
     "output_type": "stream",
     "text": [
      "0.409881\n"
     ]
    }
   ],
   "source": [
    "y_true = df_valid['fatal/day'].values\n",
    "y_pred = np.exp(model.predict(X_valid))-1\n",
    "score = calc_score(y_true, y_pred)\n",
    "print(\"{:.6f}\".format(score))"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 157,
   "metadata": {},
   "outputs": [
    {
     "data": {
      "text/html": [
       "<div>\n",
       "<style scoped>\n",
       "    .dataframe tbody tr th:only-of-type {\n",
       "        vertical-align: middle;\n",
       "    }\n",
       "\n",
       "    .dataframe tbody tr th {\n",
       "        vertical-align: top;\n",
       "    }\n",
       "\n",
       "    .dataframe thead th {\n",
       "        text-align: right;\n",
       "    }\n",
       "</style>\n",
       "<table border=\"1\" class=\"dataframe\">\n",
       "  <thead>\n",
       "    <tr style=\"text-align: right;\">\n",
       "      <th></th>\n",
       "      <th>feature</th>\n",
       "      <th>importance</th>\n",
       "    </tr>\n",
       "  </thead>\n",
       "  <tbody>\n",
       "    <tr>\n",
       "      <th>4</th>\n",
       "      <td>fatal/day-(1-7)</td>\n",
       "      <td>335</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>3</th>\n",
       "      <td>cases/day-(1-7)</td>\n",
       "      <td>255</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>2</th>\n",
       "      <td>cases/day-(1-1)</td>\n",
       "      <td>244</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>1</th>\n",
       "      <td>Long</td>\n",
       "      <td>131</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>0</th>\n",
       "      <td>Lat</td>\n",
       "      <td>94</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>5</th>\n",
       "      <td>fatal/day-(8-14)</td>\n",
       "      <td>87</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>8</th>\n",
       "      <td>density</td>\n",
       "      <td>51</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>6</th>\n",
       "      <td>fatal/day-(15-21)</td>\n",
       "      <td>27</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>7</th>\n",
       "      <td>SmokingRate</td>\n",
       "      <td>22</td>\n",
       "    </tr>\n",
       "  </tbody>\n",
       "</table>\n",
       "</div>"
      ],
      "text/plain": [
       "             feature  importance\n",
       "4    fatal/day-(1-7)         335\n",
       "3    cases/day-(1-7)         255\n",
       "2    cases/day-(1-1)         244\n",
       "1               Long         131\n",
       "0                Lat          94\n",
       "5   fatal/day-(8-14)          87\n",
       "8            density          51\n",
       "6  fatal/day-(15-21)          27\n",
       "7        SmokingRate          22"
      ]
     },
     "execution_count": 157,
     "metadata": {},
     "output_type": "execute_result"
    }
   ],
   "source": [
    "tmp = pd.DataFrame()\n",
    "tmp[\"feature\"] = col_var\n",
    "tmp[\"importance\"] = model.feature_importance()\n",
    "tmp = tmp.sort_values('importance', ascending=False)\n",
    "tmp[:10]          "
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 119,
   "metadata": {},
   "outputs": [],
   "source": [
    "###########观察最后一次参数选择的结果模型"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 158,
   "metadata": {},
   "outputs": [
    {
     "name": "stderr",
     "output_type": "stream",
     "text": [
      "F:\\Anaconda\\lib\\site-packages\\lightgbm\\basic.py:1243: UserWarning: Using categorical_feature in Dataset.\n",
      "  warnings.warn('Using categorical_feature in Dataset.')\n"
     ]
    },
    {
     "name": "stdout",
     "output_type": "stream",
     "text": [
      "Training until validation scores don't improve for 150 rounds\n",
      "[100]\ttraining's l2: 0.0146119\tvalid_1's l2: 0.0377734\n",
      "[200]\ttraining's l2: 0.00999437\tvalid_1's l2: 0.0351832\n",
      "[300]\ttraining's l2: 0.00845074\tvalid_1's l2: 0.0369364\n",
      "Early stopping, best iteration is:\n",
      "[178]\ttraining's l2: 0.0106467\tvalid_1's l2: 0.0344871\n"
     ]
    }
   ],
   "source": [
    "col_cat = []\n",
    "#####################当然是划分训练集和验证集\n",
    "#####################日期序号为61天前的数据作为训练集合\n",
    "#####################日期学号为61-72天的数据作为验证集合\n",
    "df_train = df_traintest8[(pd.isna(df_traintest8['ForecastId'])) & (df_traintest8['day']<61)]\n",
    "df_valid = df_traintest8[(pd.isna(df_traintest8['ForecastId'])) & (df_traintest8['day']>=61) & (df_traintest8['day']<72)]\n",
    "df_test = df_traintest8[pd.isna(df_traintest8['ForecastId'])==False]\n",
    "X_train = df_train[col_var] \n",
    "X_valid = df_valid[col_var]\n",
    "#######################为什么要取对数：取对数可以缩小特别大特别小的数据之间的差别，比如1和e10,相当于排除了特殊点？\n",
    "#######################最后得到的最佳参数肯定是不变的\n",
    "y_train = np.log(df_train[col_target].values.clip(0, 1e10)+1)\n",
    "y_valid = np.log(df_valid[col_target].values.clip(0, 1e10)+1)\n",
    "#######################lgb封装自身的训练集\n",
    "train_data = lgb.Dataset(X_train, label=y_train, categorical_feature=col_cat)\n",
    "valid_data = lgb.Dataset(X_valid, label=y_valid, categorical_feature=col_cat)\n",
    "num_round = 15000\n",
    "model = lgb.train(params, train_data, num_round, valid_sets=[train_data, valid_data],\n",
    "                  verbose_eval=100, ###########每100次输出一次评测结果\n",
    "                  early_stopping_rounds=150,)      #############如果连续150轮都无法优化，那么就提前停下\n",
    "\n",
    "best_itr = model.best_iteration"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 159,
   "metadata": {},
   "outputs": [
    {
     "name": "stdout",
     "output_type": "stream",
     "text": [
      "0.185707\n"
     ]
    }
   ],
   "source": [
    "y_true = df_valid['fatal/day'].values\n",
    "y_pred = np.exp(model.predict(X_valid))-1\n",
    "score = calc_score(y_true, y_pred)\n",
    "print(\"{:.6f}\".format(score))"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 130,
   "metadata": {},
   "outputs": [],
   "source": [
    "#############正式训练死亡速率模型\n",
    "#############首先希望拟合一个72天内效果最好的曲线\n",
    "#############同时把72天内的数据作为验证集和数据集，"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 166,
   "metadata": {},
   "outputs": [
    {
     "name": "stderr",
     "output_type": "stream",
     "text": [
      "F:\\Anaconda\\lib\\site-packages\\lightgbm\\basic.py:1243: UserWarning: Using categorical_feature in Dataset.\n",
      "  warnings.warn('Using categorical_feature in Dataset.')\n"
     ]
    },
    {
     "name": "stdout",
     "output_type": "stream",
     "text": [
      "Training until validation scores don't improve for 150 rounds\n",
      "[100]\ttraining's l2: 0.0379893\tvalid_1's l2: 0.0379893\n",
      "Did not meet early stopping. Best iteration is:\n",
      "[178]\ttraining's l2: 0.0306593\tvalid_1's l2: 0.0306593\n"
     ]
    }
   ],
   "source": [
    "df_train = df_traintest8[(pd.isna(df_traintest8['ForecastId'])) & (df_traintest8['day']<84)]\n",
    "df_valid = df_traintest8[(pd.isna(df_traintest8['ForecastId'])) & (df_traintest8['day']<84)]\n",
    "df_test = df_traintest8[pd.isna(df_traintest8['ForecastId'])==False]\n",
    "X_train = df_train[col_var]\n",
    "X_valid = df_valid[col_var]\n",
    "y_train = np.log(df_train[col_target].values.clip(0, 1e10)+1)\n",
    "y_valid = np.log(df_valid[col_target].values.clip(0, 1e10)+1)\n",
    "train_data = lgb.Dataset(X_train, label=y_train, categorical_feature=col_cat)\n",
    "valid_data = lgb.Dataset(X_valid, label=y_valid, categorical_feature=col_cat)\n",
    "model = lgb.train(params, train_data, best_itr, valid_sets=[train_data, valid_data],\n",
    "                  verbose_eval=100,\n",
    "                  early_stopping_rounds=150,)"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 169,
   "metadata": {},
   "outputs": [],
   "source": [
    "########################注意啊，这是我预测死亡人数数据的model"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 170,
   "metadata": {},
   "outputs": [],
   "source": [
    "import os\n",
    "from sklearn.externals import joblib"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 171,
   "metadata": {},
   "outputs": [
    {
     "data": {
      "text/plain": [
       "['fatal.pkl']"
      ]
     },
     "execution_count": 171,
     "metadata": {},
     "output_type": "execute_result"
    }
   ],
   "source": [
    "joblib.dump(model, \"fatal.pkl\")"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": null,
   "metadata": {},
   "outputs": [],
   "source": []
  },
  {
   "cell_type": "code",
   "execution_count": null,
   "metadata": {},
   "outputs": [],
   "source": []
  },
  {
   "cell_type": "code",
   "execution_count": 115,
   "metadata": {},
   "outputs": [],
   "source": [
    "###################在整个给定的打上标签的集合中训练数a###################在整个给定的打上标签的集合中训练数据\n",
    "###################训练模型到此结束\n",
    "###################目标是训练数据"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 116,
   "metadata": {},
   "outputs": [],
   "source": [
    "##########################训练确诊数据"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 117,
   "metadata": {},
   "outputs": [],
   "source": [
    "##########################根据筛选致死数据因变量的经验，要筛选确诊的因变量要多考虑确诊的趋势数据"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 118,
   "metadata": {},
   "outputs": [],
   "source": [
    "##################根据前一次的选择因变量的经验,取消时长数据,不如先保留所有的确诊趋势,然后除去所有的时长数据只保留一个。"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 119,
   "metadata": {},
   "outputs": [],
   "source": [
    "#######让我康康效果\n",
    "#######怎么这么好？"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": null,
   "metadata": {},
   "outputs": [],
   "source": []
  },
  {
   "cell_type": "code",
   "execution_count": null,
   "metadata": {},
   "outputs": [],
   "source": []
  },
  {
   "cell_type": "code",
   "execution_count": null,
   "metadata": {},
   "outputs": [],
   "source": []
  },
  {
   "cell_type": "code",
   "execution_count": 172,
   "metadata": {},
   "outputs": [],
   "source": [
    "col_target2 = 'cases/day'\n",
    "col_var2 = [\n",
    "    'Lat', 'Long',\n",
    "    'cases/day-(1-1)', \n",
    "    'cases/day-(1-7)', \n",
    "    'cases/day-(8-14)',  \n",
    "    'cases/day-(15-21)', \n",
    "    'days_since_10cases'\n",
    "]"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 173,
   "metadata": {},
   "outputs": [
    {
     "name": "stdout",
     "output_type": "stream",
     "text": [
      "Training until validation scores don't improve for 150 rounds\n",
      "[100]\ttraining's l2: 0.118047\tvalid_1's l2: 0.414527\n",
      "[200]\ttraining's l2: 0.0924633\tvalid_1's l2: 0.386546\n",
      "[300]\ttraining's l2: 0.0849622\tvalid_1's l2: 0.391332\n",
      "Early stopping, best iteration is:\n",
      "[214]\ttraining's l2: 0.0911738\tvalid_1's l2: 0.385793\n"
     ]
    }
   ],
   "source": [
    "col_cat = []\n",
    "df_train = df_traintest8[(pd.isna(df_traintest8['ForecastId'])) & (df_traintest8['day']<61)]\n",
    "df_valid = df_traintest8[(pd.isna(df_traintest8['ForecastId'])) & (df_traintest8['day']>=61) & (df_traintest8['day']<72)]\n",
    "# df_valid = df_traintest8[(pd.isna(df_traintest8['ForecastId'])) & (df_traintest8['day']>=61)]\n",
    "df_test = df_traintest8[pd.isna(df_traintest8['ForecastId'])==False]\n",
    "X_train = df_train[col_var2]\n",
    "X_valid = df_valid[col_var2]\n",
    "y_train = np.log(df_train[col_target2].values.clip(0, 1e10)+1)\n",
    "y_valid = np.log(df_valid[col_target2].values.clip(0, 1e10)+1)\n",
    "train_data = lgb.Dataset(X_train, label=y_train, categorical_feature=col_cat)\n",
    "valid_data = lgb.Dataset(X_valid, label=y_valid, categorical_feature=col_cat)\n",
    "model2 = lgb.train(params, train_data, num_round, valid_sets=[train_data, valid_data],\n",
    "                  verbose_eval=100,\n",
    "                  early_stopping_rounds=150,)\n",
    "best_itr = model2.best_iteration"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 174,
   "metadata": {},
   "outputs": [
    {
     "name": "stdout",
     "output_type": "stream",
     "text": [
      "0.621122\n"
     ]
    }
   ],
   "source": [
    "y_true = df_valid['cases/day'].values\n",
    "y_pred = np.exp(model2.predict(X_valid))-1\n",
    "score = calc_score(y_true, y_pred)\n",
    "print(\"{:.6f}\".format(score))                ##################还可以"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 141,
   "metadata": {},
   "outputs": [],
   "source": [
    "##########################同理训练72天内最优拟合曲线\n",
    "#########################就是在72天内学习"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 175,
   "metadata": {},
   "outputs": [
    {
     "data": {
      "text/plain": [
       "'cases/day'"
      ]
     },
     "execution_count": 175,
     "metadata": {},
     "output_type": "execute_result"
    }
   ],
   "source": [
    "col_target2"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 176,
   "metadata": {},
   "outputs": [
    {
     "name": "stderr",
     "output_type": "stream",
     "text": [
      "F:\\Anaconda\\lib\\site-packages\\lightgbm\\basic.py:1243: UserWarning: Using categorical_feature in Dataset.\n",
      "  warnings.warn('Using categorical_feature in Dataset.')\n"
     ]
    },
    {
     "name": "stdout",
     "output_type": "stream",
     "text": [
      "Training until validation scores don't improve for 150 rounds\n",
      "[100]\ttraining's l2: 0.17206\tvalid_1's l2: 0.17206\n",
      "[200]\ttraining's l2: 0.145899\tvalid_1's l2: 0.145899\n",
      "Did not meet early stopping. Best iteration is:\n",
      "[214]\ttraining's l2: 0.144685\tvalid_1's l2: 0.144685\n"
     ]
    }
   ],
   "source": [
    "df_train = df_traintest8[(pd.isna(df_traintest8['ForecastId'])) & (df_traintest8['day']<72)]\n",
    "df_valid = df_traintest8[(pd.isna(df_traintest8['ForecastId'])) & (df_traintest8['day']<72)]\n",
    "# df_valid = df_traintest8[(pd.isna(df_traintest8['ForecastId'])) & (df_traintest8['day']>=61)]\n",
    "df_test = df_traintest8[pd.isna(df_traintest8['ForecastId'])==False]\n",
    "X_train = df_train[col_var2]\n",
    "X_valid = df_valid[col_var2]\n",
    "y_train = np.log(df_train[col_target2].values.clip(0, 1e10)+1)\n",
    "y_valid = np.log(df_valid[col_target2].values.clip(0, 1e10)+1)\n",
    "train_data = lgb.Dataset(X_train, label=y_train, categorical_feature=col_cat)\n",
    "valid_data = lgb.Dataset(X_valid, label=y_valid, categorical_feature=col_cat)\n",
    "model2 = lgb.train(params, train_data, best_itr, valid_sets=[train_data, valid_data],\n",
    "                  verbose_eval=100,\n",
    "                  early_stopping_rounds=150,)"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 177,
   "metadata": {},
   "outputs": [
    {
     "name": "stdout",
     "output_type": "stream",
     "text": [
      "0.380375\n"
     ]
    }
   ],
   "source": [
    "y_true = df_valid['cases/day'].values\n",
    "y_pred = np.exp(model2.predict(X_valid))-1\n",
    "score = calc_score(y_true, y_pred)\n",
    "print(\"{:.6f}\".format(score))"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 147,
   "metadata": {},
   "outputs": [],
   "source": [
    "###########################接下来才开始训练模型，之前都在拟合最优的一条曲线，训练真正的模型\n",
    "##########################合理的验证集以及训练集\n",
    "##########################只是数据集合不同啊，其他和前面都一样\n",
    "########################为什么要这么做？\n",
    "################首先在训练集和测试集上学习好的参数\n",
    "###############这个学习不是最终的学习过程\n",
    "###########是一个调参的补充啊\n",
    "#############最终的学习要在整个数据集和上啊\n",
    "############警告：这很重要。"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 178,
   "metadata": {},
   "outputs": [
    {
     "name": "stderr",
     "output_type": "stream",
     "text": [
      "F:\\Anaconda\\lib\\site-packages\\lightgbm\\basic.py:1243: UserWarning: Using categorical_feature in Dataset.\n",
      "  warnings.warn('Using categorical_feature in Dataset.')\n"
     ]
    },
    {
     "name": "stdout",
     "output_type": "stream",
     "text": [
      "Training until validation scores don't improve for 150 rounds\n",
      "[100]\ttraining's l2: 0.0167647\tvalid_1's l2: 0.174123\n",
      "[200]\ttraining's l2: 0.012578\tvalid_1's l2: 0.151485\n",
      "[300]\ttraining's l2: 0.0110832\tvalid_1's l2: 0.151148\n",
      "Early stopping, best iteration is:\n",
      "[233]\ttraining's l2: 0.0119751\tvalid_1's l2: 0.149924\n"
     ]
    }
   ],
   "source": [
    "df_train = df_traintest8[(pd.isna(df_traintest8['ForecastId'])) & (df_traintest8['day']<72)]\n",
    "df_valid = df_traintest8[(pd.isna(df_traintest8['ForecastId'])) & (df_traintest8['day']>=72)]\n",
    "df_test = df_traintest8[pd.isna(df_traintest8['ForecastId'])==False]\n",
    "X_train = df_train[col_var]\n",
    "X_valid = df_valid[col_var]\n",
    "y_train = np.log(df_train[col_target].values.clip(0, 1e10)+1)\n",
    "y_valid = np.log(df_valid[col_target].values.clip(0, 1e10)+1)\n",
    "train_data = lgb.Dataset(X_train, label=y_train, categorical_feature=col_cat)\n",
    "valid_data = lgb.Dataset(X_valid, label=y_valid, categorical_feature=col_cat)\n",
    "model_pri = lgb.train(params, train_data, num_round, valid_sets=[train_data, valid_data],\n",
    "                  verbose_eval=100,\n",
    "                  early_stopping_rounds=150,)\n",
    "best_itr = model_pri.best_iteration"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 179,
   "metadata": {},
   "outputs": [],
   "source": [
    "######################这又是整体拟合最优曲线"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 180,
   "metadata": {},
   "outputs": [
    {
     "name": "stdout",
     "output_type": "stream",
     "text": [
      "Training until validation scores don't improve for 150 rounds\n",
      "[100]\ttraining's l2: 0.0404401\tvalid_1's l2: 0.0404401\n",
      "[200]\ttraining's l2: 0.0314542\tvalid_1's l2: 0.0314542\n",
      "Did not meet early stopping. Best iteration is:\n",
      "[233]\ttraining's l2: 0.0303997\tvalid_1's l2: 0.0303997\n"
     ]
    }
   ],
   "source": [
    "df_train = df_traintest8[(pd.isna(df_traintest8['ForecastId']))]\n",
    "df_valid = df_traintest8[(pd.isna(df_traintest8['ForecastId']))]\n",
    "# df_valid = df_traintest8[(pd.isna(df_traintest8['ForecastId'])) & (df_traintest8['day']>=61)]\n",
    "df_test = df_traintest8[pd.isna(df_traintest8['ForecastId'])==False]\n",
    "X_train = df_train[col_var]\n",
    "X_valid = df_valid[col_var]\n",
    "y_train = np.log(df_train[col_target].values.clip(0, 1e10)+1)\n",
    "y_valid = np.log(df_valid[col_target].values.clip(0, 1e10)+1)\n",
    "train_data = lgb.Dataset(X_train, label=y_train, categorical_feature=col_cat)\n",
    "valid_data = lgb.Dataset(X_valid, label=y_valid, categorical_feature=col_cat)\n",
    "model_pri = lgb.train(params, train_data, best_itr, valid_sets=[train_data, valid_data],\n",
    "                  verbose_eval=100,\n",
    "                  early_stopping_rounds=150,)"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 181,
   "metadata": {},
   "outputs": [
    {
     "name": "stdout",
     "output_type": "stream",
     "text": [
      "Training until validation scores don't improve for 150 rounds\n",
      "[100]\ttraining's l2: 0.17206\tvalid_1's l2: 1.07604\n",
      "[200]\ttraining's l2: 0.145899\tvalid_1's l2: 0.908828\n",
      "[300]\ttraining's l2: 0.138875\tvalid_1's l2: 0.897021\n",
      "[400]\ttraining's l2: 0.134658\tvalid_1's l2: 0.894278\n",
      "[500]\ttraining's l2: 0.130806\tvalid_1's l2: 0.893842\n",
      "[600]\ttraining's l2: 0.126825\tvalid_1's l2: 0.888879\n",
      "[700]\ttraining's l2: 0.123596\tvalid_1's l2: 0.887921\n",
      "[800]\ttraining's l2: 0.120808\tvalid_1's l2: 0.883392\n",
      "[900]\ttraining's l2: 0.118145\tvalid_1's l2: 0.886353\n",
      "Early stopping, best iteration is:\n",
      "[775]\ttraining's l2: 0.121464\tvalid_1's l2: 0.881927\n"
     ]
    }
   ],
   "source": [
    "# train model to predict fatalities/day\n",
    "df_train = df_traintest8[(pd.isna(df_traintest8['ForecastId'])) & (df_traintest8['day']<72)]\n",
    "df_valid = df_traintest8[(pd.isna(df_traintest8['ForecastId'])) & (df_traintest8['day']>=72)]\n",
    "# df_valid = df_traintest8[(pd.isna(df_traintest8['ForecastId'])) & (df_traintest8['day']>=61)]\n",
    "df_test = df_traintest8[pd.isna(df_traintest8['ForecastId'])==False]\n",
    "X_train = df_train[col_var2]\n",
    "X_valid = df_valid[col_var2]\n",
    "y_train = np.log(df_train[col_target2].values.clip(0, 1e10)+1)\n",
    "y_valid = np.log(df_valid[col_target2].values.clip(0, 1e10)+1)\n",
    "train_data = lgb.Dataset(X_train, label=y_train, categorical_feature=col_cat)\n",
    "valid_data = lgb.Dataset(X_valid, label=y_valid, categorical_feature=col_cat)\n",
    "model2_pri = lgb.train(params, train_data, num_round, valid_sets=[train_data, valid_data],\n",
    "                  verbose_eval=100,\n",
    "                  early_stopping_rounds=150,)\n",
    "best_itr = model2_pri.best_iteration"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 182,
   "metadata": {},
   "outputs": [
    {
     "name": "stdout",
     "output_type": "stream",
     "text": [
      "Training until validation scores don't improve for 150 rounds\n",
      "[100]\ttraining's l2: 0.318129\tvalid_1's l2: 0.318129\n",
      "[200]\ttraining's l2: 0.27225\tvalid_1's l2: 0.27225\n",
      "[300]\ttraining's l2: 0.262128\tvalid_1's l2: 0.262128\n",
      "[400]\ttraining's l2: 0.255557\tvalid_1's l2: 0.255557\n",
      "[500]\ttraining's l2: 0.250233\tvalid_1's l2: 0.250233\n",
      "[600]\ttraining's l2: 0.244828\tvalid_1's l2: 0.244828\n",
      "[700]\ttraining's l2: 0.241069\tvalid_1's l2: 0.241069\n",
      "Did not meet early stopping. Best iteration is:\n",
      "[775]\ttraining's l2: 0.238231\tvalid_1's l2: 0.238231\n"
     ]
    }
   ],
   "source": [
    "df_train = df_traintest8[(pd.isna(df_traintest8['ForecastId']))]\n",
    "df_valid = df_traintest8[(pd.isna(df_traintest8['ForecastId']))]\n",
    "# df_valid = df_traintest8[(pd.isna(df_traintest8['ForecastId'])) & (df_traintest8['day']>=61)]\n",
    "df_test = df_traintest8[pd.isna(df_traintest8['ForecastId'])==False]\n",
    "X_train = df_train[col_var2]\n",
    "X_valid = df_valid[col_var2]\n",
    "y_train = np.log(df_train[col_target2].values.clip(0, 1e10)+1)\n",
    "y_valid = np.log(df_valid[col_target2].values.clip(0, 1e10)+1)\n",
    "train_data = lgb.Dataset(X_train, label=y_train, categorical_feature=col_cat)\n",
    "valid_data = lgb.Dataset(X_valid, label=y_valid, categorical_feature=col_cat)\n",
    "model2_pri = lgb.train(params, train_data, best_itr, valid_sets=[train_data, valid_data],\n",
    "                  verbose_eval=100,\n",
    "                  early_stopping_rounds=150,)\n",
    "best_itr = model2_pri.best_iteration"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 183,
   "metadata": {},
   "outputs": [
    {
     "data": {
      "text/plain": [
       "['case.pkl']"
      ]
     },
     "execution_count": 183,
     "metadata": {},
     "output_type": "execute_result"
    }
   ],
   "source": [
    "joblib.dump(model2_pri, \"case.pkl\")"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": null,
   "metadata": {},
   "outputs": [],
   "source": [
    "#################################加载我们已经训练好的模型"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 190,
   "metadata": {},
   "outputs": [],
   "source": [
    "fatal_model=joblib.load(\"fatal.pkl\")\n",
    "case_model=joblib.load(\"fatal.pkl\")"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": null,
   "metadata": {},
   "outputs": [],
   "source": [
    "###########################我们直接预测，可视化工作不需要我们做"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 193,
   "metadata": {},
   "outputs": [
    {
     "name": "stderr",
     "output_type": "stream",
     "text": [
      "F:\\Anaconda\\lib\\site-packages\\ipykernel_launcher.py:6: SettingWithCopyWarning: \n",
      "A value is trying to be set on a copy of a slice from a DataFrame\n",
      "\n",
      "See the caveats in the documentation: https://pandas.pydata.org/pandas-docs/stable/user_guide/indexing.html#returning-a-view-versus-a-copy\n",
      "  \n",
      "F:\\Anaconda\\lib\\site-packages\\ipykernel_launcher.py:7: SettingWithCopyWarning: \n",
      "A value is trying to be set on a copy of a slice from a DataFrame\n",
      "\n",
      "See the caveats in the documentation: https://pandas.pydata.org/pandas-docs/stable/user_guide/indexing.html#returning-a-view-versus-a-copy\n",
      "  import sys\n"
     ]
    },
    {
     "data": {
      "text/html": [
       "<div>\n",
       "<style scoped>\n",
       "    .dataframe tbody tr th:only-of-type {\n",
       "        vertical-align: middle;\n",
       "    }\n",
       "\n",
       "    .dataframe tbody tr th {\n",
       "        vertical-align: top;\n",
       "    }\n",
       "\n",
       "    .dataframe thead th {\n",
       "        text-align: right;\n",
       "    }\n",
       "</style>\n",
       "<table border=\"1\" class=\"dataframe\">\n",
       "  <thead>\n",
       "    <tr style=\"text-align: right;\">\n",
       "      <th></th>\n",
       "      <th>Id</th>\n",
       "      <th>Province/State</th>\n",
       "      <th>Country/Region</th>\n",
       "      <th>Lat</th>\n",
       "      <th>Long</th>\n",
       "      <th>Date</th>\n",
       "      <th>ConfirmedCases</th>\n",
       "      <th>Fatalities</th>\n",
       "      <th>ForecastId</th>\n",
       "      <th>place_id</th>\n",
       "      <th>day</th>\n",
       "      <th>cases/day</th>\n",
       "      <th>fatal/day</th>\n",
       "      <th>SmokingRate</th>\n",
       "      <th>Country</th>\n",
       "      <th>Gross_domestic_product__constant_prices</th>\n",
       "      <th>Gross_domestic_product__current_prices</th>\n",
       "      <th>Gross_domestic_product__deflator</th>\n",
       "      <th>Gross_domestic_product_per_capita__constant_prices</th>\n",
       "      <th>Gross_domestic_product_per_capita__current_prices</th>\n",
       "      <th>Output_gap_in_percent_of_potential_GDP</th>\n",
       "      <th>Gross_domestic_product_based_on_purchasing_power_parity__PPP__valuation_of_country_GDP</th>\n",
       "      <th>Gross_domestic_product_based_on_purchasing_power_parity__PPP__per_capita_GDP</th>\n",
       "      <th>Gross_domestic_product_based_on_purchasing_power_parity__PPP__share_of_world_total</th>\n",
       "      <th>Implied_PPP_conversion_rate</th>\n",
       "      <th>Total_investment</th>\n",
       "      <th>Gross_national_savings</th>\n",
       "      <th>Inflation__average_consumer_prices</th>\n",
       "      <th>Inflation__end_of_period_consumer_prices</th>\n",
       "      <th>Six_month_London_interbank_offered_rate__LIBOR_</th>\n",
       "      <th>Volume_of_imports_of_goods_and_services</th>\n",
       "      <th>Volume_of_Imports_of_goods</th>\n",
       "      <th>Volume_of_exports_of_goods_and_services</th>\n",
       "      <th>Volume_of_exports_of_goods</th>\n",
       "      <th>Unemployment_rate</th>\n",
       "      <th>Employment</th>\n",
       "      <th>Population</th>\n",
       "      <th>General_government_revenue</th>\n",
       "      <th>General_government_total_expenditure</th>\n",
       "      <th>General_government_net_lending_borrowing</th>\n",
       "      <th>General_government_structural_balance</th>\n",
       "      <th>General_government_primary_net_lending_borrowing</th>\n",
       "      <th>General_government_net_debt</th>\n",
       "      <th>General_government_gross_debt</th>\n",
       "      <th>Gross_domestic_product_corresponding_to_fiscal_year__current_prices</th>\n",
       "      <th>Current_account_balance</th>\n",
       "      <th>LifeExpectancy</th>\n",
       "      <th>pop</th>\n",
       "      <th>density</th>\n",
       "      <th>medianage</th>\n",
       "      <th>urbanpop</th>\n",
       "      <th>quarantine</th>\n",
       "      <th>schools</th>\n",
       "      <th>hospibed</th>\n",
       "      <th>smokers</th>\n",
       "      <th>sex0</th>\n",
       "      <th>sex14</th>\n",
       "      <th>sex25</th>\n",
       "      <th>sex54</th>\n",
       "      <th>sex64</th>\n",
       "      <th>sex65plus</th>\n",
       "      <th>sexratio</th>\n",
       "      <th>lung</th>\n",
       "      <th>femalelung</th>\n",
       "      <th>malelung</th>\n",
       "      <th>id</th>\n",
       "      <th>Country/Region_le</th>\n",
       "      <th>Province/State_le</th>\n",
       "      <th>cases/day-(1-1)</th>\n",
       "      <th>cases/day-(1-7)</th>\n",
       "      <th>cases/day-(8-14)</th>\n",
       "      <th>cases/day-(15-21)</th>\n",
       "      <th>fatal/day-(1-1)</th>\n",
       "      <th>fatal/day-(1-7)</th>\n",
       "      <th>fatal/day-(8-14)</th>\n",
       "      <th>fatal/day-(15-21)</th>\n",
       "      <th>days_since_1cases</th>\n",
       "      <th>days_since_10cases</th>\n",
       "      <th>days_since_100cases</th>\n",
       "      <th>days_since_1fatal</th>\n",
       "      <th>days_since_10fatal</th>\n",
       "      <th>days_since_100fatal</th>\n",
       "    </tr>\n",
       "  </thead>\n",
       "  <tbody>\n",
       "    <tr>\n",
       "      <th>0</th>\n",
       "      <td>NaN</td>\n",
       "      <td>nan</td>\n",
       "      <td>Afghanistan</td>\n",
       "      <td>33.0</td>\n",
       "      <td>65.0</td>\n",
       "      <td>2020-03-12</td>\n",
       "      <td>NaN</td>\n",
       "      <td>NaN</td>\n",
       "      <td>1.0</td>\n",
       "      <td>Afghanistan</td>\n",
       "      <td>72</td>\n",
       "      <td>-9.223372e+18</td>\n",
       "      <td>-9.223372e+18</td>\n",
       "      <td>20.475517</td>\n",
       "      <td>Afghanistan</td>\n",
       "      <td>528.154</td>\n",
       "      <td>1692.57</td>\n",
       "      <td>320.469</td>\n",
       "      <td>14300.19</td>\n",
       "      <td>45827.64</td>\n",
       "      <td>NaN</td>\n",
       "      <td>75.87</td>\n",
       "      <td>2054.23</td>\n",
       "      <td>0.053</td>\n",
       "      <td>22.309</td>\n",
       "      <td>18.346</td>\n",
       "      <td>20.174</td>\n",
       "      <td>124.809</td>\n",
       "      <td>131.29</td>\n",
       "      <td>NaN</td>\n",
       "      <td>3.559</td>\n",
       "      <td>2.773</td>\n",
       "      <td>13.252</td>\n",
       "      <td>17.026</td>\n",
       "      <td>NaN</td>\n",
       "      <td>NaN</td>\n",
       "      <td>36.933</td>\n",
       "      <td>469.79</td>\n",
       "      <td>467.62</td>\n",
       "      <td>2.17</td>\n",
       "      <td>NaN</td>\n",
       "      <td>2.532</td>\n",
       "      <td>NaN</td>\n",
       "      <td>101.669</td>\n",
       "      <td>1692.57</td>\n",
       "      <td>0.425</td>\n",
       "      <td>64.5</td>\n",
       "      <td>38928346.0</td>\n",
       "      <td>60.0</td>\n",
       "      <td>18.0</td>\n",
       "      <td>25.0</td>\n",
       "      <td>NaN</td>\n",
       "      <td>NaN</td>\n",
       "      <td>0.5</td>\n",
       "      <td>NaN</td>\n",
       "      <td>1.05</td>\n",
       "      <td>1.03</td>\n",
       "      <td>1.03</td>\n",
       "      <td>1.03</td>\n",
       "      <td>0.97</td>\n",
       "      <td>0.85</td>\n",
       "      <td>1.03</td>\n",
       "      <td>37.62</td>\n",
       "      <td>36.31</td>\n",
       "      <td>39.33</td>\n",
       "      <td>63</td>\n",
       "      <td>23</td>\n",
       "      <td>0</td>\n",
       "      <td>0.000000e+00</td>\n",
       "      <td>0.0</td>\n",
       "      <td>0.0</td>\n",
       "      <td>0.0</td>\n",
       "      <td>0.000000e+00</td>\n",
       "      <td>0.0</td>\n",
       "      <td>0.0</td>\n",
       "      <td>0.0</td>\n",
       "      <td>50</td>\n",
       "      <td>50</td>\n",
       "      <td>50</td>\n",
       "      <td>50</td>\n",
       "      <td>50</td>\n",
       "      <td>50</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>1</th>\n",
       "      <td>NaN</td>\n",
       "      <td>nan</td>\n",
       "      <td>Afghanistan</td>\n",
       "      <td>33.0</td>\n",
       "      <td>65.0</td>\n",
       "      <td>2020-03-13</td>\n",
       "      <td>NaN</td>\n",
       "      <td>NaN</td>\n",
       "      <td>2.0</td>\n",
       "      <td>Afghanistan</td>\n",
       "      <td>73</td>\n",
       "      <td>-9.223372e+18</td>\n",
       "      <td>-9.223372e+18</td>\n",
       "      <td>20.475517</td>\n",
       "      <td>Afghanistan</td>\n",
       "      <td>528.154</td>\n",
       "      <td>1692.57</td>\n",
       "      <td>320.469</td>\n",
       "      <td>14300.19</td>\n",
       "      <td>45827.64</td>\n",
       "      <td>NaN</td>\n",
       "      <td>75.87</td>\n",
       "      <td>2054.23</td>\n",
       "      <td>0.053</td>\n",
       "      <td>22.309</td>\n",
       "      <td>18.346</td>\n",
       "      <td>20.174</td>\n",
       "      <td>124.809</td>\n",
       "      <td>131.29</td>\n",
       "      <td>NaN</td>\n",
       "      <td>3.559</td>\n",
       "      <td>2.773</td>\n",
       "      <td>13.252</td>\n",
       "      <td>17.026</td>\n",
       "      <td>NaN</td>\n",
       "      <td>NaN</td>\n",
       "      <td>36.933</td>\n",
       "      <td>469.79</td>\n",
       "      <td>467.62</td>\n",
       "      <td>2.17</td>\n",
       "      <td>NaN</td>\n",
       "      <td>2.532</td>\n",
       "      <td>NaN</td>\n",
       "      <td>101.669</td>\n",
       "      <td>1692.57</td>\n",
       "      <td>0.425</td>\n",
       "      <td>64.5</td>\n",
       "      <td>38928346.0</td>\n",
       "      <td>60.0</td>\n",
       "      <td>18.0</td>\n",
       "      <td>25.0</td>\n",
       "      <td>NaN</td>\n",
       "      <td>NaN</td>\n",
       "      <td>0.5</td>\n",
       "      <td>NaN</td>\n",
       "      <td>1.05</td>\n",
       "      <td>1.03</td>\n",
       "      <td>1.03</td>\n",
       "      <td>1.03</td>\n",
       "      <td>0.97</td>\n",
       "      <td>0.85</td>\n",
       "      <td>1.03</td>\n",
       "      <td>37.62</td>\n",
       "      <td>36.31</td>\n",
       "      <td>39.33</td>\n",
       "      <td>64</td>\n",
       "      <td>23</td>\n",
       "      <td>0</td>\n",
       "      <td>-9.223372e+18</td>\n",
       "      <td>0.0</td>\n",
       "      <td>0.0</td>\n",
       "      <td>0.0</td>\n",
       "      <td>-9.223372e+18</td>\n",
       "      <td>0.0</td>\n",
       "      <td>0.0</td>\n",
       "      <td>0.0</td>\n",
       "      <td>51</td>\n",
       "      <td>51</td>\n",
       "      <td>51</td>\n",
       "      <td>51</td>\n",
       "      <td>51</td>\n",
       "      <td>51</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>2</th>\n",
       "      <td>NaN</td>\n",
       "      <td>nan</td>\n",
       "      <td>Afghanistan</td>\n",
       "      <td>33.0</td>\n",
       "      <td>65.0</td>\n",
       "      <td>2020-03-14</td>\n",
       "      <td>NaN</td>\n",
       "      <td>NaN</td>\n",
       "      <td>3.0</td>\n",
       "      <td>Afghanistan</td>\n",
       "      <td>74</td>\n",
       "      <td>-9.223372e+18</td>\n",
       "      <td>-9.223372e+18</td>\n",
       "      <td>20.475517</td>\n",
       "      <td>Afghanistan</td>\n",
       "      <td>528.154</td>\n",
       "      <td>1692.57</td>\n",
       "      <td>320.469</td>\n",
       "      <td>14300.19</td>\n",
       "      <td>45827.64</td>\n",
       "      <td>NaN</td>\n",
       "      <td>75.87</td>\n",
       "      <td>2054.23</td>\n",
       "      <td>0.053</td>\n",
       "      <td>22.309</td>\n",
       "      <td>18.346</td>\n",
       "      <td>20.174</td>\n",
       "      <td>124.809</td>\n",
       "      <td>131.29</td>\n",
       "      <td>NaN</td>\n",
       "      <td>3.559</td>\n",
       "      <td>2.773</td>\n",
       "      <td>13.252</td>\n",
       "      <td>17.026</td>\n",
       "      <td>NaN</td>\n",
       "      <td>NaN</td>\n",
       "      <td>36.933</td>\n",
       "      <td>469.79</td>\n",
       "      <td>467.62</td>\n",
       "      <td>2.17</td>\n",
       "      <td>NaN</td>\n",
       "      <td>2.532</td>\n",
       "      <td>NaN</td>\n",
       "      <td>101.669</td>\n",
       "      <td>1692.57</td>\n",
       "      <td>0.425</td>\n",
       "      <td>64.5</td>\n",
       "      <td>38928346.0</td>\n",
       "      <td>60.0</td>\n",
       "      <td>18.0</td>\n",
       "      <td>25.0</td>\n",
       "      <td>NaN</td>\n",
       "      <td>NaN</td>\n",
       "      <td>0.5</td>\n",
       "      <td>NaN</td>\n",
       "      <td>1.05</td>\n",
       "      <td>1.03</td>\n",
       "      <td>1.03</td>\n",
       "      <td>1.03</td>\n",
       "      <td>0.97</td>\n",
       "      <td>0.85</td>\n",
       "      <td>1.03</td>\n",
       "      <td>37.62</td>\n",
       "      <td>36.31</td>\n",
       "      <td>39.33</td>\n",
       "      <td>65</td>\n",
       "      <td>23</td>\n",
       "      <td>0</td>\n",
       "      <td>-9.223372e+18</td>\n",
       "      <td>0.0</td>\n",
       "      <td>0.0</td>\n",
       "      <td>0.0</td>\n",
       "      <td>-9.223372e+18</td>\n",
       "      <td>0.0</td>\n",
       "      <td>0.0</td>\n",
       "      <td>0.0</td>\n",
       "      <td>52</td>\n",
       "      <td>52</td>\n",
       "      <td>52</td>\n",
       "      <td>52</td>\n",
       "      <td>52</td>\n",
       "      <td>52</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>3</th>\n",
       "      <td>NaN</td>\n",
       "      <td>nan</td>\n",
       "      <td>Afghanistan</td>\n",
       "      <td>33.0</td>\n",
       "      <td>65.0</td>\n",
       "      <td>2020-03-15</td>\n",
       "      <td>NaN</td>\n",
       "      <td>NaN</td>\n",
       "      <td>4.0</td>\n",
       "      <td>Afghanistan</td>\n",
       "      <td>75</td>\n",
       "      <td>-9.223372e+18</td>\n",
       "      <td>-9.223372e+18</td>\n",
       "      <td>20.475517</td>\n",
       "      <td>Afghanistan</td>\n",
       "      <td>528.154</td>\n",
       "      <td>1692.57</td>\n",
       "      <td>320.469</td>\n",
       "      <td>14300.19</td>\n",
       "      <td>45827.64</td>\n",
       "      <td>NaN</td>\n",
       "      <td>75.87</td>\n",
       "      <td>2054.23</td>\n",
       "      <td>0.053</td>\n",
       "      <td>22.309</td>\n",
       "      <td>18.346</td>\n",
       "      <td>20.174</td>\n",
       "      <td>124.809</td>\n",
       "      <td>131.29</td>\n",
       "      <td>NaN</td>\n",
       "      <td>3.559</td>\n",
       "      <td>2.773</td>\n",
       "      <td>13.252</td>\n",
       "      <td>17.026</td>\n",
       "      <td>NaN</td>\n",
       "      <td>NaN</td>\n",
       "      <td>36.933</td>\n",
       "      <td>469.79</td>\n",
       "      <td>467.62</td>\n",
       "      <td>2.17</td>\n",
       "      <td>NaN</td>\n",
       "      <td>2.532</td>\n",
       "      <td>NaN</td>\n",
       "      <td>101.669</td>\n",
       "      <td>1692.57</td>\n",
       "      <td>0.425</td>\n",
       "      <td>64.5</td>\n",
       "      <td>38928346.0</td>\n",
       "      <td>60.0</td>\n",
       "      <td>18.0</td>\n",
       "      <td>25.0</td>\n",
       "      <td>NaN</td>\n",
       "      <td>NaN</td>\n",
       "      <td>0.5</td>\n",
       "      <td>NaN</td>\n",
       "      <td>1.05</td>\n",
       "      <td>1.03</td>\n",
       "      <td>1.03</td>\n",
       "      <td>1.03</td>\n",
       "      <td>0.97</td>\n",
       "      <td>0.85</td>\n",
       "      <td>1.03</td>\n",
       "      <td>37.62</td>\n",
       "      <td>36.31</td>\n",
       "      <td>39.33</td>\n",
       "      <td>66</td>\n",
       "      <td>23</td>\n",
       "      <td>0</td>\n",
       "      <td>-9.223372e+18</td>\n",
       "      <td>0.0</td>\n",
       "      <td>0.0</td>\n",
       "      <td>0.0</td>\n",
       "      <td>-9.223372e+18</td>\n",
       "      <td>0.0</td>\n",
       "      <td>0.0</td>\n",
       "      <td>0.0</td>\n",
       "      <td>53</td>\n",
       "      <td>53</td>\n",
       "      <td>53</td>\n",
       "      <td>53</td>\n",
       "      <td>53</td>\n",
       "      <td>53</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>4</th>\n",
       "      <td>NaN</td>\n",
       "      <td>nan</td>\n",
       "      <td>Afghanistan</td>\n",
       "      <td>33.0</td>\n",
       "      <td>65.0</td>\n",
       "      <td>2020-03-16</td>\n",
       "      <td>NaN</td>\n",
       "      <td>NaN</td>\n",
       "      <td>5.0</td>\n",
       "      <td>Afghanistan</td>\n",
       "      <td>76</td>\n",
       "      <td>-9.223372e+18</td>\n",
       "      <td>-9.223372e+18</td>\n",
       "      <td>20.475517</td>\n",
       "      <td>Afghanistan</td>\n",
       "      <td>528.154</td>\n",
       "      <td>1692.57</td>\n",
       "      <td>320.469</td>\n",
       "      <td>14300.19</td>\n",
       "      <td>45827.64</td>\n",
       "      <td>NaN</td>\n",
       "      <td>75.87</td>\n",
       "      <td>2054.23</td>\n",
       "      <td>0.053</td>\n",
       "      <td>22.309</td>\n",
       "      <td>18.346</td>\n",
       "      <td>20.174</td>\n",
       "      <td>124.809</td>\n",
       "      <td>131.29</td>\n",
       "      <td>NaN</td>\n",
       "      <td>3.559</td>\n",
       "      <td>2.773</td>\n",
       "      <td>13.252</td>\n",
       "      <td>17.026</td>\n",
       "      <td>NaN</td>\n",
       "      <td>NaN</td>\n",
       "      <td>36.933</td>\n",
       "      <td>469.79</td>\n",
       "      <td>467.62</td>\n",
       "      <td>2.17</td>\n",
       "      <td>NaN</td>\n",
       "      <td>2.532</td>\n",
       "      <td>NaN</td>\n",
       "      <td>101.669</td>\n",
       "      <td>1692.57</td>\n",
       "      <td>0.425</td>\n",
       "      <td>64.5</td>\n",
       "      <td>38928346.0</td>\n",
       "      <td>60.0</td>\n",
       "      <td>18.0</td>\n",
       "      <td>25.0</td>\n",
       "      <td>NaN</td>\n",
       "      <td>NaN</td>\n",
       "      <td>0.5</td>\n",
       "      <td>NaN</td>\n",
       "      <td>1.05</td>\n",
       "      <td>1.03</td>\n",
       "      <td>1.03</td>\n",
       "      <td>1.03</td>\n",
       "      <td>0.97</td>\n",
       "      <td>0.85</td>\n",
       "      <td>1.03</td>\n",
       "      <td>37.62</td>\n",
       "      <td>36.31</td>\n",
       "      <td>39.33</td>\n",
       "      <td>67</td>\n",
       "      <td>23</td>\n",
       "      <td>0</td>\n",
       "      <td>-9.223372e+18</td>\n",
       "      <td>0.0</td>\n",
       "      <td>0.0</td>\n",
       "      <td>0.0</td>\n",
       "      <td>-9.223372e+18</td>\n",
       "      <td>0.0</td>\n",
       "      <td>0.0</td>\n",
       "      <td>0.0</td>\n",
       "      <td>54</td>\n",
       "      <td>54</td>\n",
       "      <td>54</td>\n",
       "      <td>54</td>\n",
       "      <td>54</td>\n",
       "      <td>54</td>\n",
       "    </tr>\n",
       "  </tbody>\n",
       "</table>\n",
       "</div>"
      ],
      "text/plain": [
       "   Id Province/State Country/Region   Lat  Long       Date  ConfirmedCases  \\\n",
       "0 NaN            nan    Afghanistan  33.0  65.0 2020-03-12             NaN   \n",
       "1 NaN            nan    Afghanistan  33.0  65.0 2020-03-13             NaN   \n",
       "2 NaN            nan    Afghanistan  33.0  65.0 2020-03-14             NaN   \n",
       "3 NaN            nan    Afghanistan  33.0  65.0 2020-03-15             NaN   \n",
       "4 NaN            nan    Afghanistan  33.0  65.0 2020-03-16             NaN   \n",
       "\n",
       "   Fatalities  ForecastId     place_id  day     cases/day     fatal/day  \\\n",
       "0         NaN         1.0  Afghanistan   72 -9.223372e+18 -9.223372e+18   \n",
       "1         NaN         2.0  Afghanistan   73 -9.223372e+18 -9.223372e+18   \n",
       "2         NaN         3.0  Afghanistan   74 -9.223372e+18 -9.223372e+18   \n",
       "3         NaN         4.0  Afghanistan   75 -9.223372e+18 -9.223372e+18   \n",
       "4         NaN         5.0  Afghanistan   76 -9.223372e+18 -9.223372e+18   \n",
       "\n",
       "   SmokingRate      Country  Gross_domestic_product__constant_prices  \\\n",
       "0    20.475517  Afghanistan                                  528.154   \n",
       "1    20.475517  Afghanistan                                  528.154   \n",
       "2    20.475517  Afghanistan                                  528.154   \n",
       "3    20.475517  Afghanistan                                  528.154   \n",
       "4    20.475517  Afghanistan                                  528.154   \n",
       "\n",
       "   Gross_domestic_product__current_prices  Gross_domestic_product__deflator  \\\n",
       "0                                 1692.57                           320.469   \n",
       "1                                 1692.57                           320.469   \n",
       "2                                 1692.57                           320.469   \n",
       "3                                 1692.57                           320.469   \n",
       "4                                 1692.57                           320.469   \n",
       "\n",
       "   Gross_domestic_product_per_capita__constant_prices  \\\n",
       "0                                           14300.19    \n",
       "1                                           14300.19    \n",
       "2                                           14300.19    \n",
       "3                                           14300.19    \n",
       "4                                           14300.19    \n",
       "\n",
       "   Gross_domestic_product_per_capita__current_prices  \\\n",
       "0                                           45827.64   \n",
       "1                                           45827.64   \n",
       "2                                           45827.64   \n",
       "3                                           45827.64   \n",
       "4                                           45827.64   \n",
       "\n",
       "   Output_gap_in_percent_of_potential_GDP  \\\n",
       "0                                     NaN   \n",
       "1                                     NaN   \n",
       "2                                     NaN   \n",
       "3                                     NaN   \n",
       "4                                     NaN   \n",
       "\n",
       "   Gross_domestic_product_based_on_purchasing_power_parity__PPP__valuation_of_country_GDP  \\\n",
       "0                                              75.87                                        \n",
       "1                                              75.87                                        \n",
       "2                                              75.87                                        \n",
       "3                                              75.87                                        \n",
       "4                                              75.87                                        \n",
       "\n",
       "   Gross_domestic_product_based_on_purchasing_power_parity__PPP__per_capita_GDP  \\\n",
       "0                                            2054.23                              \n",
       "1                                            2054.23                              \n",
       "2                                            2054.23                              \n",
       "3                                            2054.23                              \n",
       "4                                            2054.23                              \n",
       "\n",
       "   Gross_domestic_product_based_on_purchasing_power_parity__PPP__share_of_world_total  \\\n",
       "0                                              0.053                                    \n",
       "1                                              0.053                                    \n",
       "2                                              0.053                                    \n",
       "3                                              0.053                                    \n",
       "4                                              0.053                                    \n",
       "\n",
       "   Implied_PPP_conversion_rate  Total_investment  Gross_national_savings  \\\n",
       "0                       22.309            18.346                  20.174   \n",
       "1                       22.309            18.346                  20.174   \n",
       "2                       22.309            18.346                  20.174   \n",
       "3                       22.309            18.346                  20.174   \n",
       "4                       22.309            18.346                  20.174   \n",
       "\n",
       "   Inflation__average_consumer_prices  \\\n",
       "0                             124.809   \n",
       "1                             124.809   \n",
       "2                             124.809   \n",
       "3                             124.809   \n",
       "4                             124.809   \n",
       "\n",
       "   Inflation__end_of_period_consumer_prices  \\\n",
       "0                                    131.29   \n",
       "1                                    131.29   \n",
       "2                                    131.29   \n",
       "3                                    131.29   \n",
       "4                                    131.29   \n",
       "\n",
       "   Six_month_London_interbank_offered_rate__LIBOR_  \\\n",
       "0                                              NaN   \n",
       "1                                              NaN   \n",
       "2                                              NaN   \n",
       "3                                              NaN   \n",
       "4                                              NaN   \n",
       "\n",
       "   Volume_of_imports_of_goods_and_services  Volume_of_Imports_of_goods  \\\n",
       "0                                    3.559                       2.773   \n",
       "1                                    3.559                       2.773   \n",
       "2                                    3.559                       2.773   \n",
       "3                                    3.559                       2.773   \n",
       "4                                    3.559                       2.773   \n",
       "\n",
       "   Volume_of_exports_of_goods_and_services  Volume_of_exports_of_goods  \\\n",
       "0                                   13.252                      17.026   \n",
       "1                                   13.252                      17.026   \n",
       "2                                   13.252                      17.026   \n",
       "3                                   13.252                      17.026   \n",
       "4                                   13.252                      17.026   \n",
       "\n",
       "   Unemployment_rate  Employment  Population  General_government_revenue  \\\n",
       "0                NaN         NaN      36.933                      469.79   \n",
       "1                NaN         NaN      36.933                      469.79   \n",
       "2                NaN         NaN      36.933                      469.79   \n",
       "3                NaN         NaN      36.933                      469.79   \n",
       "4                NaN         NaN      36.933                      469.79   \n",
       "\n",
       "   General_government_total_expenditure  \\\n",
       "0                                467.62   \n",
       "1                                467.62   \n",
       "2                                467.62   \n",
       "3                                467.62   \n",
       "4                                467.62   \n",
       "\n",
       "   General_government_net_lending_borrowing  \\\n",
       "0                                      2.17   \n",
       "1                                      2.17   \n",
       "2                                      2.17   \n",
       "3                                      2.17   \n",
       "4                                      2.17   \n",
       "\n",
       "   General_government_structural_balance  \\\n",
       "0                                    NaN   \n",
       "1                                    NaN   \n",
       "2                                    NaN   \n",
       "3                                    NaN   \n",
       "4                                    NaN   \n",
       "\n",
       "   General_government_primary_net_lending_borrowing  \\\n",
       "0                                             2.532   \n",
       "1                                             2.532   \n",
       "2                                             2.532   \n",
       "3                                             2.532   \n",
       "4                                             2.532   \n",
       "\n",
       "   General_government_net_debt  General_government_gross_debt  \\\n",
       "0                          NaN                        101.669   \n",
       "1                          NaN                        101.669   \n",
       "2                          NaN                        101.669   \n",
       "3                          NaN                        101.669   \n",
       "4                          NaN                        101.669   \n",
       "\n",
       "   Gross_domestic_product_corresponding_to_fiscal_year__current_prices  \\\n",
       "0                                            1692.57                     \n",
       "1                                            1692.57                     \n",
       "2                                            1692.57                     \n",
       "3                                            1692.57                     \n",
       "4                                            1692.57                     \n",
       "\n",
       "   Current_account_balance  LifeExpectancy         pop  density  medianage  \\\n",
       "0                    0.425            64.5  38928346.0     60.0       18.0   \n",
       "1                    0.425            64.5  38928346.0     60.0       18.0   \n",
       "2                    0.425            64.5  38928346.0     60.0       18.0   \n",
       "3                    0.425            64.5  38928346.0     60.0       18.0   \n",
       "4                    0.425            64.5  38928346.0     60.0       18.0   \n",
       "\n",
       "   urbanpop quarantine schools  hospibed  smokers  sex0  sex14  sex25  sex54  \\\n",
       "0      25.0        NaN     NaN       0.5      NaN  1.05   1.03   1.03   1.03   \n",
       "1      25.0        NaN     NaN       0.5      NaN  1.05   1.03   1.03   1.03   \n",
       "2      25.0        NaN     NaN       0.5      NaN  1.05   1.03   1.03   1.03   \n",
       "3      25.0        NaN     NaN       0.5      NaN  1.05   1.03   1.03   1.03   \n",
       "4      25.0        NaN     NaN       0.5      NaN  1.05   1.03   1.03   1.03   \n",
       "\n",
       "   sex64  sex65plus  sexratio   lung  femalelung  malelung  id  \\\n",
       "0   0.97       0.85      1.03  37.62       36.31     39.33  63   \n",
       "1   0.97       0.85      1.03  37.62       36.31     39.33  64   \n",
       "2   0.97       0.85      1.03  37.62       36.31     39.33  65   \n",
       "3   0.97       0.85      1.03  37.62       36.31     39.33  66   \n",
       "4   0.97       0.85      1.03  37.62       36.31     39.33  67   \n",
       "\n",
       "   Country/Region_le  Province/State_le  cases/day-(1-1)  cases/day-(1-7)  \\\n",
       "0                 23                  0     0.000000e+00              0.0   \n",
       "1                 23                  0    -9.223372e+18              0.0   \n",
       "2                 23                  0    -9.223372e+18              0.0   \n",
       "3                 23                  0    -9.223372e+18              0.0   \n",
       "4                 23                  0    -9.223372e+18              0.0   \n",
       "\n",
       "   cases/day-(8-14)  cases/day-(15-21)  fatal/day-(1-1)  fatal/day-(1-7)  \\\n",
       "0               0.0                0.0     0.000000e+00              0.0   \n",
       "1               0.0                0.0    -9.223372e+18              0.0   \n",
       "2               0.0                0.0    -9.223372e+18              0.0   \n",
       "3               0.0                0.0    -9.223372e+18              0.0   \n",
       "4               0.0                0.0    -9.223372e+18              0.0   \n",
       "\n",
       "   fatal/day-(8-14)  fatal/day-(15-21)  days_since_1cases  days_since_10cases  \\\n",
       "0               0.0                0.0                 50                  50   \n",
       "1               0.0                0.0                 51                  51   \n",
       "2               0.0                0.0                 52                  52   \n",
       "3               0.0                0.0                 53                  53   \n",
       "4               0.0                0.0                 54                  54   \n",
       "\n",
       "   days_since_100cases  days_since_1fatal  days_since_10fatal  \\\n",
       "0                   50                 50                  50   \n",
       "1                   51                 51                  51   \n",
       "2                   52                 52                  52   \n",
       "3                   53                 53                  53   \n",
       "4                   54                 54                  54   \n",
       "\n",
       "   days_since_100fatal  \n",
       "0                   50  \n",
       "1                   51  \n",
       "2                   52  \n",
       "3                   53  \n",
       "4                   54  "
      ]
     },
     "execution_count": 193,
     "metadata": {},
     "output_type": "execute_result"
    }
   ],
   "source": [
    "df_tmp = df_traintest8[(pd.isna(df_traintest8['ForecastId'])==False)].reset_index(drop=True)\n",
    "################################删除之前聚合的数据项\n",
    "df_tmp = df_tmp.drop([\n",
    "    'cases/day-(1-1)', 'cases/day-(1-7)', 'cases/day-(8-14)', 'cases/day-(15-21)', \n",
    "    'fatal/day-(1-1)', 'fatal/day-(1-7)', 'fatal/day-(8-14)', 'fatal/day-(15-21)',\n",
    "    'days_since_1cases', 'days_since_10cases', 'days_since_100cases',\n",
    "    'days_since_1fatal', 'days_since_10fatal', 'days_since_100fatal',\n",
    "                               ],  axis=1)\n",
    "df_traintest9 = []\n",
    "######重新聚合\n",
    "for i, place in enumerate(places[:]):\n",
    "    df_tmp2 = df_tmp[df_tmp['place_id']==place].reset_index(drop=True)\n",
    "    df_tmp2 = do_aggregations(df_tmp2)\n",
    "    df_traintest9.append(df_tmp2)\n",
    "df_traintest9 = pd.concat(df_traintest9).reset_index(drop=True)\n",
    "df_traintest9[df_traintest9['day']>68].head()"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 199,
   "metadata": {},
   "outputs": [],
   "source": [
    "##我们选定好Afghanistan地区作为预测对象"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 196,
   "metadata": {},
   "outputs": [],
   "source": [
    "place = 'Afghanistan'\n",
    "df_interest_base = df_traintest9[df_traintest9['place_id']==place].reset_index(drop=True)\n",
    "df_interest = copy.deepcopy(df_interest_base)\n",
    "df_interest['ConfirmedCases'] = df_interest['ConfirmedCases'].astype(np.float)\n",
    "df_interest['cases/day'] = df_interest['cases/day'].astype(np.float)\n",
    "df_interest['fatal/day'] = df_interest['fatal/day'].astype(np.float)\n",
    "df_interest['Fatalities'] = df_interest['Fatalities'].astype(np.float)\n",
    "X_valid = df_interest[col_var]\n",
    "X_valid2 = df_interest[col_var2]\n",
    "pred_f =  np.exp(fatal_model.predict(X_valid))-1\n",
    "pred_c = np.exp(case_model.predict(X_valid2))-1\n",
    "df_interest['fatal/day'] = pred_f.clip(0, 1e10)\n",
    "df_interest['cases/day'] = pred_c.clip(0, 1e10)\n",
    "df_interest['Fatalities'] = np.cumsum(df_interest['fatal/day'].values)\n",
    "df_interest['ConfirmedCases'] = np.cumsum(df_interest['cases/day'].values)"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": null,
   "metadata": {},
   "outputs": [],
   "source": []
  },
  {
   "cell_type": "code",
   "execution_count": null,
   "metadata": {},
   "outputs": [],
   "source": []
  },
  {
   "cell_type": "code",
   "execution_count": null,
   "metadata": {},
   "outputs": [],
   "source": []
  },
  {
   "cell_type": "code",
   "execution_count": null,
   "metadata": {},
   "outputs": [],
   "source": []
  },
  {
   "cell_type": "code",
   "execution_count": null,
   "metadata": {},
   "outputs": [],
   "source": []
  },
  {
   "cell_type": "code",
   "execution_count": null,
   "metadata": {},
   "outputs": [],
   "source": []
  },
  {
   "cell_type": "code",
   "execution_count": null,
   "metadata": {},
   "outputs": [],
   "source": []
  },
  {
   "cell_type": "code",
   "execution_count": null,
   "metadata": {},
   "outputs": [],
   "source": []
  },
  {
   "cell_type": "code",
   "execution_count": null,
   "metadata": {},
   "outputs": [],
   "source": []
  },
  {
   "cell_type": "code",
   "execution_count": null,
   "metadata": {},
   "outputs": [],
   "source": []
  },
  {
   "cell_type": "code",
   "execution_count": null,
   "metadata": {},
   "outputs": [],
   "source": []
  },
  {
   "cell_type": "code",
   "execution_count": null,
   "metadata": {},
   "outputs": [],
   "source": []
  },
  {
   "cell_type": "code",
   "execution_count": null,
   "metadata": {},
   "outputs": [],
   "source": []
  },
  {
   "cell_type": "code",
   "execution_count": null,
   "metadata": {},
   "outputs": [],
   "source": []
  },
  {
   "cell_type": "code",
   "execution_count": null,
   "metadata": {},
   "outputs": [],
   "source": []
  },
  {
   "cell_type": "code",
   "execution_count": null,
   "metadata": {},
   "outputs": [],
   "source": []
  },
  {
   "cell_type": "code",
   "execution_count": null,
   "metadata": {},
   "outputs": [],
   "source": []
  },
  {
   "cell_type": "code",
   "execution_count": null,
   "metadata": {},
   "outputs": [],
   "source": []
  },
  {
   "cell_type": "code",
   "execution_count": 136,
   "metadata": {},
   "outputs": [],
   "source": [
    "###################模型可视化部分"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 200,
   "metadata": {},
   "outputs": [
    {
     "name": "stderr",
     "output_type": "stream",
     "text": [
      "F:\\Anaconda\\lib\\site-packages\\ipykernel_launcher.py:6: SettingWithCopyWarning: \n",
      "A value is trying to be set on a copy of a slice from a DataFrame\n",
      "\n",
      "See the caveats in the documentation: https://pandas.pydata.org/pandas-docs/stable/user_guide/indexing.html#returning-a-view-versus-a-copy\n",
      "  \n",
      "F:\\Anaconda\\lib\\site-packages\\ipykernel_launcher.py:7: SettingWithCopyWarning: \n",
      "A value is trying to be set on a copy of a slice from a DataFrame\n",
      "\n",
      "See the caveats in the documentation: https://pandas.pydata.org/pandas-docs/stable/user_guide/indexing.html#returning-a-view-versus-a-copy\n",
      "  import sys\n"
     ]
    },
    {
     "data": {
      "text/html": [
       "<div>\n",
       "<style scoped>\n",
       "    .dataframe tbody tr th:only-of-type {\n",
       "        vertical-align: middle;\n",
       "    }\n",
       "\n",
       "    .dataframe tbody tr th {\n",
       "        vertical-align: top;\n",
       "    }\n",
       "\n",
       "    .dataframe thead th {\n",
       "        text-align: right;\n",
       "    }\n",
       "</style>\n",
       "<table border=\"1\" class=\"dataframe\">\n",
       "  <thead>\n",
       "    <tr style=\"text-align: right;\">\n",
       "      <th></th>\n",
       "      <th>Id</th>\n",
       "      <th>Province/State</th>\n",
       "      <th>Country/Region</th>\n",
       "      <th>Lat</th>\n",
       "      <th>Long</th>\n",
       "      <th>Date</th>\n",
       "      <th>ConfirmedCases</th>\n",
       "      <th>Fatalities</th>\n",
       "      <th>ForecastId</th>\n",
       "      <th>place_id</th>\n",
       "      <th>day</th>\n",
       "      <th>cases/day</th>\n",
       "      <th>fatal/day</th>\n",
       "      <th>SmokingRate</th>\n",
       "      <th>Country</th>\n",
       "      <th>Gross_domestic_product__constant_prices</th>\n",
       "      <th>Gross_domestic_product__current_prices</th>\n",
       "      <th>Gross_domestic_product__deflator</th>\n",
       "      <th>Gross_domestic_product_per_capita__constant_prices</th>\n",
       "      <th>Gross_domestic_product_per_capita__current_prices</th>\n",
       "      <th>Output_gap_in_percent_of_potential_GDP</th>\n",
       "      <th>Gross_domestic_product_based_on_purchasing_power_parity__PPP__valuation_of_country_GDP</th>\n",
       "      <th>Gross_domestic_product_based_on_purchasing_power_parity__PPP__per_capita_GDP</th>\n",
       "      <th>Gross_domestic_product_based_on_purchasing_power_parity__PPP__share_of_world_total</th>\n",
       "      <th>Implied_PPP_conversion_rate</th>\n",
       "      <th>Total_investment</th>\n",
       "      <th>Gross_national_savings</th>\n",
       "      <th>Inflation__average_consumer_prices</th>\n",
       "      <th>Inflation__end_of_period_consumer_prices</th>\n",
       "      <th>Six_month_London_interbank_offered_rate__LIBOR_</th>\n",
       "      <th>Volume_of_imports_of_goods_and_services</th>\n",
       "      <th>Volume_of_Imports_of_goods</th>\n",
       "      <th>Volume_of_exports_of_goods_and_services</th>\n",
       "      <th>Volume_of_exports_of_goods</th>\n",
       "      <th>Unemployment_rate</th>\n",
       "      <th>Employment</th>\n",
       "      <th>Population</th>\n",
       "      <th>General_government_revenue</th>\n",
       "      <th>General_government_total_expenditure</th>\n",
       "      <th>General_government_net_lending_borrowing</th>\n",
       "      <th>General_government_structural_balance</th>\n",
       "      <th>General_government_primary_net_lending_borrowing</th>\n",
       "      <th>General_government_net_debt</th>\n",
       "      <th>General_government_gross_debt</th>\n",
       "      <th>Gross_domestic_product_corresponding_to_fiscal_year__current_prices</th>\n",
       "      <th>Current_account_balance</th>\n",
       "      <th>LifeExpectancy</th>\n",
       "      <th>pop</th>\n",
       "      <th>density</th>\n",
       "      <th>medianage</th>\n",
       "      <th>urbanpop</th>\n",
       "      <th>quarantine</th>\n",
       "      <th>schools</th>\n",
       "      <th>hospibed</th>\n",
       "      <th>smokers</th>\n",
       "      <th>sex0</th>\n",
       "      <th>sex14</th>\n",
       "      <th>sex25</th>\n",
       "      <th>sex54</th>\n",
       "      <th>sex64</th>\n",
       "      <th>sex65plus</th>\n",
       "      <th>sexratio</th>\n",
       "      <th>lung</th>\n",
       "      <th>femalelung</th>\n",
       "      <th>malelung</th>\n",
       "      <th>id</th>\n",
       "      <th>Country/Region_le</th>\n",
       "      <th>Province/State_le</th>\n",
       "      <th>cases/day-(1-1)</th>\n",
       "      <th>cases/day-(1-7)</th>\n",
       "      <th>cases/day-(8-14)</th>\n",
       "      <th>cases/day-(15-21)</th>\n",
       "      <th>fatal/day-(1-1)</th>\n",
       "      <th>fatal/day-(1-7)</th>\n",
       "      <th>fatal/day-(8-14)</th>\n",
       "      <th>fatal/day-(15-21)</th>\n",
       "      <th>days_since_1cases</th>\n",
       "      <th>days_since_10cases</th>\n",
       "      <th>days_since_100cases</th>\n",
       "      <th>days_since_1fatal</th>\n",
       "      <th>days_since_10fatal</th>\n",
       "      <th>days_since_100fatal</th>\n",
       "    </tr>\n",
       "  </thead>\n",
       "  <tbody>\n",
       "    <tr>\n",
       "      <th>47</th>\n",
       "      <td>48.0</td>\n",
       "      <td>nan</td>\n",
       "      <td>Afghanistan</td>\n",
       "      <td>33.0</td>\n",
       "      <td>65.0</td>\n",
       "      <td>2020-03-09</td>\n",
       "      <td>4.0</td>\n",
       "      <td>0.0</td>\n",
       "      <td>NaN</td>\n",
       "      <td>Afghanistan</td>\n",
       "      <td>69</td>\n",
       "      <td>0.000000e+00</td>\n",
       "      <td>0.000000e+00</td>\n",
       "      <td>20.475517</td>\n",
       "      <td>Afghanistan</td>\n",
       "      <td>528.154</td>\n",
       "      <td>1692.57</td>\n",
       "      <td>320.469</td>\n",
       "      <td>14300.19</td>\n",
       "      <td>45827.64</td>\n",
       "      <td>NaN</td>\n",
       "      <td>75.87</td>\n",
       "      <td>2054.23</td>\n",
       "      <td>0.053</td>\n",
       "      <td>22.309</td>\n",
       "      <td>18.346</td>\n",
       "      <td>20.174</td>\n",
       "      <td>124.809</td>\n",
       "      <td>131.29</td>\n",
       "      <td>NaN</td>\n",
       "      <td>3.559</td>\n",
       "      <td>2.773</td>\n",
       "      <td>13.252</td>\n",
       "      <td>17.026</td>\n",
       "      <td>NaN</td>\n",
       "      <td>NaN</td>\n",
       "      <td>36.933</td>\n",
       "      <td>469.79</td>\n",
       "      <td>467.62</td>\n",
       "      <td>2.17</td>\n",
       "      <td>NaN</td>\n",
       "      <td>2.532</td>\n",
       "      <td>NaN</td>\n",
       "      <td>101.669</td>\n",
       "      <td>1692.57</td>\n",
       "      <td>0.425</td>\n",
       "      <td>64.5</td>\n",
       "      <td>38928346.0</td>\n",
       "      <td>60.0</td>\n",
       "      <td>18.0</td>\n",
       "      <td>25.0</td>\n",
       "      <td>NaN</td>\n",
       "      <td>NaN</td>\n",
       "      <td>0.5</td>\n",
       "      <td>NaN</td>\n",
       "      <td>1.05</td>\n",
       "      <td>1.03</td>\n",
       "      <td>1.03</td>\n",
       "      <td>1.03</td>\n",
       "      <td>0.97</td>\n",
       "      <td>0.85</td>\n",
       "      <td>1.03</td>\n",
       "      <td>37.62</td>\n",
       "      <td>36.31</td>\n",
       "      <td>39.33</td>\n",
       "      <td>47</td>\n",
       "      <td>23</td>\n",
       "      <td>0</td>\n",
       "      <td>3.000000e+00</td>\n",
       "      <td>4.285714e-01</td>\n",
       "      <td>0.142857</td>\n",
       "      <td>0.000000</td>\n",
       "      <td>0.000000e+00</td>\n",
       "      <td>0.000000e+00</td>\n",
       "      <td>0.0</td>\n",
       "      <td>0.0</td>\n",
       "      <td>14</td>\n",
       "      <td>0</td>\n",
       "      <td>0</td>\n",
       "      <td>0</td>\n",
       "      <td>0</td>\n",
       "      <td>0</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>48</th>\n",
       "      <td>49.0</td>\n",
       "      <td>nan</td>\n",
       "      <td>Afghanistan</td>\n",
       "      <td>33.0</td>\n",
       "      <td>65.0</td>\n",
       "      <td>2020-03-10</td>\n",
       "      <td>5.0</td>\n",
       "      <td>0.0</td>\n",
       "      <td>NaN</td>\n",
       "      <td>Afghanistan</td>\n",
       "      <td>70</td>\n",
       "      <td>1.000000e+00</td>\n",
       "      <td>0.000000e+00</td>\n",
       "      <td>20.475517</td>\n",
       "      <td>Afghanistan</td>\n",
       "      <td>528.154</td>\n",
       "      <td>1692.57</td>\n",
       "      <td>320.469</td>\n",
       "      <td>14300.19</td>\n",
       "      <td>45827.64</td>\n",
       "      <td>NaN</td>\n",
       "      <td>75.87</td>\n",
       "      <td>2054.23</td>\n",
       "      <td>0.053</td>\n",
       "      <td>22.309</td>\n",
       "      <td>18.346</td>\n",
       "      <td>20.174</td>\n",
       "      <td>124.809</td>\n",
       "      <td>131.29</td>\n",
       "      <td>NaN</td>\n",
       "      <td>3.559</td>\n",
       "      <td>2.773</td>\n",
       "      <td>13.252</td>\n",
       "      <td>17.026</td>\n",
       "      <td>NaN</td>\n",
       "      <td>NaN</td>\n",
       "      <td>36.933</td>\n",
       "      <td>469.79</td>\n",
       "      <td>467.62</td>\n",
       "      <td>2.17</td>\n",
       "      <td>NaN</td>\n",
       "      <td>2.532</td>\n",
       "      <td>NaN</td>\n",
       "      <td>101.669</td>\n",
       "      <td>1692.57</td>\n",
       "      <td>0.425</td>\n",
       "      <td>64.5</td>\n",
       "      <td>38928346.0</td>\n",
       "      <td>60.0</td>\n",
       "      <td>18.0</td>\n",
       "      <td>25.0</td>\n",
       "      <td>NaN</td>\n",
       "      <td>NaN</td>\n",
       "      <td>0.5</td>\n",
       "      <td>NaN</td>\n",
       "      <td>1.05</td>\n",
       "      <td>1.03</td>\n",
       "      <td>1.03</td>\n",
       "      <td>1.03</td>\n",
       "      <td>0.97</td>\n",
       "      <td>0.85</td>\n",
       "      <td>1.03</td>\n",
       "      <td>37.62</td>\n",
       "      <td>36.31</td>\n",
       "      <td>39.33</td>\n",
       "      <td>48</td>\n",
       "      <td>23</td>\n",
       "      <td>0</td>\n",
       "      <td>0.000000e+00</td>\n",
       "      <td>4.285714e-01</td>\n",
       "      <td>0.000000</td>\n",
       "      <td>0.142857</td>\n",
       "      <td>0.000000e+00</td>\n",
       "      <td>0.000000e+00</td>\n",
       "      <td>0.0</td>\n",
       "      <td>0.0</td>\n",
       "      <td>15</td>\n",
       "      <td>0</td>\n",
       "      <td>0</td>\n",
       "      <td>0</td>\n",
       "      <td>0</td>\n",
       "      <td>0</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>49</th>\n",
       "      <td>50.0</td>\n",
       "      <td>nan</td>\n",
       "      <td>Afghanistan</td>\n",
       "      <td>33.0</td>\n",
       "      <td>65.0</td>\n",
       "      <td>2020-03-11</td>\n",
       "      <td>7.0</td>\n",
       "      <td>0.0</td>\n",
       "      <td>NaN</td>\n",
       "      <td>Afghanistan</td>\n",
       "      <td>71</td>\n",
       "      <td>2.000000e+00</td>\n",
       "      <td>0.000000e+00</td>\n",
       "      <td>20.475517</td>\n",
       "      <td>Afghanistan</td>\n",
       "      <td>528.154</td>\n",
       "      <td>1692.57</td>\n",
       "      <td>320.469</td>\n",
       "      <td>14300.19</td>\n",
       "      <td>45827.64</td>\n",
       "      <td>NaN</td>\n",
       "      <td>75.87</td>\n",
       "      <td>2054.23</td>\n",
       "      <td>0.053</td>\n",
       "      <td>22.309</td>\n",
       "      <td>18.346</td>\n",
       "      <td>20.174</td>\n",
       "      <td>124.809</td>\n",
       "      <td>131.29</td>\n",
       "      <td>NaN</td>\n",
       "      <td>3.559</td>\n",
       "      <td>2.773</td>\n",
       "      <td>13.252</td>\n",
       "      <td>17.026</td>\n",
       "      <td>NaN</td>\n",
       "      <td>NaN</td>\n",
       "      <td>36.933</td>\n",
       "      <td>469.79</td>\n",
       "      <td>467.62</td>\n",
       "      <td>2.17</td>\n",
       "      <td>NaN</td>\n",
       "      <td>2.532</td>\n",
       "      <td>NaN</td>\n",
       "      <td>101.669</td>\n",
       "      <td>1692.57</td>\n",
       "      <td>0.425</td>\n",
       "      <td>64.5</td>\n",
       "      <td>38928346.0</td>\n",
       "      <td>60.0</td>\n",
       "      <td>18.0</td>\n",
       "      <td>25.0</td>\n",
       "      <td>NaN</td>\n",
       "      <td>NaN</td>\n",
       "      <td>0.5</td>\n",
       "      <td>NaN</td>\n",
       "      <td>1.05</td>\n",
       "      <td>1.03</td>\n",
       "      <td>1.03</td>\n",
       "      <td>1.03</td>\n",
       "      <td>0.97</td>\n",
       "      <td>0.85</td>\n",
       "      <td>1.03</td>\n",
       "      <td>37.62</td>\n",
       "      <td>36.31</td>\n",
       "      <td>39.33</td>\n",
       "      <td>49</td>\n",
       "      <td>23</td>\n",
       "      <td>0</td>\n",
       "      <td>1.000000e+00</td>\n",
       "      <td>5.714286e-01</td>\n",
       "      <td>0.000000</td>\n",
       "      <td>0.142857</td>\n",
       "      <td>0.000000e+00</td>\n",
       "      <td>0.000000e+00</td>\n",
       "      <td>0.0</td>\n",
       "      <td>0.0</td>\n",
       "      <td>16</td>\n",
       "      <td>0</td>\n",
       "      <td>0</td>\n",
       "      <td>0</td>\n",
       "      <td>0</td>\n",
       "      <td>0</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>50</th>\n",
       "      <td>NaN</td>\n",
       "      <td>nan</td>\n",
       "      <td>Afghanistan</td>\n",
       "      <td>33.0</td>\n",
       "      <td>65.0</td>\n",
       "      <td>2020-03-12</td>\n",
       "      <td>NaN</td>\n",
       "      <td>NaN</td>\n",
       "      <td>1.0</td>\n",
       "      <td>Afghanistan</td>\n",
       "      <td>72</td>\n",
       "      <td>-9.223372e+18</td>\n",
       "      <td>-9.223372e+18</td>\n",
       "      <td>20.475517</td>\n",
       "      <td>Afghanistan</td>\n",
       "      <td>528.154</td>\n",
       "      <td>1692.57</td>\n",
       "      <td>320.469</td>\n",
       "      <td>14300.19</td>\n",
       "      <td>45827.64</td>\n",
       "      <td>NaN</td>\n",
       "      <td>75.87</td>\n",
       "      <td>2054.23</td>\n",
       "      <td>0.053</td>\n",
       "      <td>22.309</td>\n",
       "      <td>18.346</td>\n",
       "      <td>20.174</td>\n",
       "      <td>124.809</td>\n",
       "      <td>131.29</td>\n",
       "      <td>NaN</td>\n",
       "      <td>3.559</td>\n",
       "      <td>2.773</td>\n",
       "      <td>13.252</td>\n",
       "      <td>17.026</td>\n",
       "      <td>NaN</td>\n",
       "      <td>NaN</td>\n",
       "      <td>36.933</td>\n",
       "      <td>469.79</td>\n",
       "      <td>467.62</td>\n",
       "      <td>2.17</td>\n",
       "      <td>NaN</td>\n",
       "      <td>2.532</td>\n",
       "      <td>NaN</td>\n",
       "      <td>101.669</td>\n",
       "      <td>1692.57</td>\n",
       "      <td>0.425</td>\n",
       "      <td>64.5</td>\n",
       "      <td>38928346.0</td>\n",
       "      <td>60.0</td>\n",
       "      <td>18.0</td>\n",
       "      <td>25.0</td>\n",
       "      <td>NaN</td>\n",
       "      <td>NaN</td>\n",
       "      <td>0.5</td>\n",
       "      <td>NaN</td>\n",
       "      <td>1.05</td>\n",
       "      <td>1.03</td>\n",
       "      <td>1.03</td>\n",
       "      <td>1.03</td>\n",
       "      <td>0.97</td>\n",
       "      <td>0.85</td>\n",
       "      <td>1.03</td>\n",
       "      <td>37.62</td>\n",
       "      <td>36.31</td>\n",
       "      <td>39.33</td>\n",
       "      <td>63</td>\n",
       "      <td>23</td>\n",
       "      <td>0</td>\n",
       "      <td>2.000000e+00</td>\n",
       "      <td>8.571429e-01</td>\n",
       "      <td>0.000000</td>\n",
       "      <td>0.142857</td>\n",
       "      <td>0.000000e+00</td>\n",
       "      <td>0.000000e+00</td>\n",
       "      <td>0.0</td>\n",
       "      <td>0.0</td>\n",
       "      <td>17</td>\n",
       "      <td>0</td>\n",
       "      <td>0</td>\n",
       "      <td>0</td>\n",
       "      <td>0</td>\n",
       "      <td>0</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>51</th>\n",
       "      <td>NaN</td>\n",
       "      <td>nan</td>\n",
       "      <td>Afghanistan</td>\n",
       "      <td>33.0</td>\n",
       "      <td>65.0</td>\n",
       "      <td>2020-03-13</td>\n",
       "      <td>NaN</td>\n",
       "      <td>NaN</td>\n",
       "      <td>2.0</td>\n",
       "      <td>Afghanistan</td>\n",
       "      <td>73</td>\n",
       "      <td>-9.223372e+18</td>\n",
       "      <td>-9.223372e+18</td>\n",
       "      <td>20.475517</td>\n",
       "      <td>Afghanistan</td>\n",
       "      <td>528.154</td>\n",
       "      <td>1692.57</td>\n",
       "      <td>320.469</td>\n",
       "      <td>14300.19</td>\n",
       "      <td>45827.64</td>\n",
       "      <td>NaN</td>\n",
       "      <td>75.87</td>\n",
       "      <td>2054.23</td>\n",
       "      <td>0.053</td>\n",
       "      <td>22.309</td>\n",
       "      <td>18.346</td>\n",
       "      <td>20.174</td>\n",
       "      <td>124.809</td>\n",
       "      <td>131.29</td>\n",
       "      <td>NaN</td>\n",
       "      <td>3.559</td>\n",
       "      <td>2.773</td>\n",
       "      <td>13.252</td>\n",
       "      <td>17.026</td>\n",
       "      <td>NaN</td>\n",
       "      <td>NaN</td>\n",
       "      <td>36.933</td>\n",
       "      <td>469.79</td>\n",
       "      <td>467.62</td>\n",
       "      <td>2.17</td>\n",
       "      <td>NaN</td>\n",
       "      <td>2.532</td>\n",
       "      <td>NaN</td>\n",
       "      <td>101.669</td>\n",
       "      <td>1692.57</td>\n",
       "      <td>0.425</td>\n",
       "      <td>64.5</td>\n",
       "      <td>38928346.0</td>\n",
       "      <td>60.0</td>\n",
       "      <td>18.0</td>\n",
       "      <td>25.0</td>\n",
       "      <td>NaN</td>\n",
       "      <td>NaN</td>\n",
       "      <td>0.5</td>\n",
       "      <td>NaN</td>\n",
       "      <td>1.05</td>\n",
       "      <td>1.03</td>\n",
       "      <td>1.03</td>\n",
       "      <td>1.03</td>\n",
       "      <td>0.97</td>\n",
       "      <td>0.85</td>\n",
       "      <td>1.03</td>\n",
       "      <td>37.62</td>\n",
       "      <td>36.31</td>\n",
       "      <td>39.33</td>\n",
       "      <td>64</td>\n",
       "      <td>23</td>\n",
       "      <td>0</td>\n",
       "      <td>-9.223372e+18</td>\n",
       "      <td>-1.317625e+18</td>\n",
       "      <td>0.000000</td>\n",
       "      <td>0.142857</td>\n",
       "      <td>-9.223372e+18</td>\n",
       "      <td>-1.317625e+18</td>\n",
       "      <td>0.0</td>\n",
       "      <td>0.0</td>\n",
       "      <td>18</td>\n",
       "      <td>1</td>\n",
       "      <td>1</td>\n",
       "      <td>1</td>\n",
       "      <td>1</td>\n",
       "      <td>1</td>\n",
       "    </tr>\n",
       "  </tbody>\n",
       "</table>\n",
       "</div>"
      ],
      "text/plain": [
       "      Id Province/State Country/Region   Lat  Long       Date  ConfirmedCases  \\\n",
       "47  48.0            nan    Afghanistan  33.0  65.0 2020-03-09             4.0   \n",
       "48  49.0            nan    Afghanistan  33.0  65.0 2020-03-10             5.0   \n",
       "49  50.0            nan    Afghanistan  33.0  65.0 2020-03-11             7.0   \n",
       "50   NaN            nan    Afghanistan  33.0  65.0 2020-03-12             NaN   \n",
       "51   NaN            nan    Afghanistan  33.0  65.0 2020-03-13             NaN   \n",
       "\n",
       "    Fatalities  ForecastId     place_id  day     cases/day     fatal/day  \\\n",
       "47         0.0         NaN  Afghanistan   69  0.000000e+00  0.000000e+00   \n",
       "48         0.0         NaN  Afghanistan   70  1.000000e+00  0.000000e+00   \n",
       "49         0.0         NaN  Afghanistan   71  2.000000e+00  0.000000e+00   \n",
       "50         NaN         1.0  Afghanistan   72 -9.223372e+18 -9.223372e+18   \n",
       "51         NaN         2.0  Afghanistan   73 -9.223372e+18 -9.223372e+18   \n",
       "\n",
       "    SmokingRate      Country  Gross_domestic_product__constant_prices  \\\n",
       "47    20.475517  Afghanistan                                  528.154   \n",
       "48    20.475517  Afghanistan                                  528.154   \n",
       "49    20.475517  Afghanistan                                  528.154   \n",
       "50    20.475517  Afghanistan                                  528.154   \n",
       "51    20.475517  Afghanistan                                  528.154   \n",
       "\n",
       "    Gross_domestic_product__current_prices  Gross_domestic_product__deflator  \\\n",
       "47                                 1692.57                           320.469   \n",
       "48                                 1692.57                           320.469   \n",
       "49                                 1692.57                           320.469   \n",
       "50                                 1692.57                           320.469   \n",
       "51                                 1692.57                           320.469   \n",
       "\n",
       "    Gross_domestic_product_per_capita__constant_prices  \\\n",
       "47                                           14300.19    \n",
       "48                                           14300.19    \n",
       "49                                           14300.19    \n",
       "50                                           14300.19    \n",
       "51                                           14300.19    \n",
       "\n",
       "    Gross_domestic_product_per_capita__current_prices  \\\n",
       "47                                           45827.64   \n",
       "48                                           45827.64   \n",
       "49                                           45827.64   \n",
       "50                                           45827.64   \n",
       "51                                           45827.64   \n",
       "\n",
       "    Output_gap_in_percent_of_potential_GDP  \\\n",
       "47                                     NaN   \n",
       "48                                     NaN   \n",
       "49                                     NaN   \n",
       "50                                     NaN   \n",
       "51                                     NaN   \n",
       "\n",
       "    Gross_domestic_product_based_on_purchasing_power_parity__PPP__valuation_of_country_GDP  \\\n",
       "47                                              75.87                                        \n",
       "48                                              75.87                                        \n",
       "49                                              75.87                                        \n",
       "50                                              75.87                                        \n",
       "51                                              75.87                                        \n",
       "\n",
       "    Gross_domestic_product_based_on_purchasing_power_parity__PPP__per_capita_GDP  \\\n",
       "47                                            2054.23                              \n",
       "48                                            2054.23                              \n",
       "49                                            2054.23                              \n",
       "50                                            2054.23                              \n",
       "51                                            2054.23                              \n",
       "\n",
       "    Gross_domestic_product_based_on_purchasing_power_parity__PPP__share_of_world_total  \\\n",
       "47                                              0.053                                    \n",
       "48                                              0.053                                    \n",
       "49                                              0.053                                    \n",
       "50                                              0.053                                    \n",
       "51                                              0.053                                    \n",
       "\n",
       "    Implied_PPP_conversion_rate  Total_investment  Gross_national_savings  \\\n",
       "47                       22.309            18.346                  20.174   \n",
       "48                       22.309            18.346                  20.174   \n",
       "49                       22.309            18.346                  20.174   \n",
       "50                       22.309            18.346                  20.174   \n",
       "51                       22.309            18.346                  20.174   \n",
       "\n",
       "    Inflation__average_consumer_prices  \\\n",
       "47                             124.809   \n",
       "48                             124.809   \n",
       "49                             124.809   \n",
       "50                             124.809   \n",
       "51                             124.809   \n",
       "\n",
       "    Inflation__end_of_period_consumer_prices  \\\n",
       "47                                    131.29   \n",
       "48                                    131.29   \n",
       "49                                    131.29   \n",
       "50                                    131.29   \n",
       "51                                    131.29   \n",
       "\n",
       "    Six_month_London_interbank_offered_rate__LIBOR_  \\\n",
       "47                                              NaN   \n",
       "48                                              NaN   \n",
       "49                                              NaN   \n",
       "50                                              NaN   \n",
       "51                                              NaN   \n",
       "\n",
       "    Volume_of_imports_of_goods_and_services  Volume_of_Imports_of_goods  \\\n",
       "47                                    3.559                       2.773   \n",
       "48                                    3.559                       2.773   \n",
       "49                                    3.559                       2.773   \n",
       "50                                    3.559                       2.773   \n",
       "51                                    3.559                       2.773   \n",
       "\n",
       "    Volume_of_exports_of_goods_and_services  Volume_of_exports_of_goods  \\\n",
       "47                                   13.252                      17.026   \n",
       "48                                   13.252                      17.026   \n",
       "49                                   13.252                      17.026   \n",
       "50                                   13.252                      17.026   \n",
       "51                                   13.252                      17.026   \n",
       "\n",
       "    Unemployment_rate  Employment  Population  General_government_revenue  \\\n",
       "47                NaN         NaN      36.933                      469.79   \n",
       "48                NaN         NaN      36.933                      469.79   \n",
       "49                NaN         NaN      36.933                      469.79   \n",
       "50                NaN         NaN      36.933                      469.79   \n",
       "51                NaN         NaN      36.933                      469.79   \n",
       "\n",
       "    General_government_total_expenditure  \\\n",
       "47                                467.62   \n",
       "48                                467.62   \n",
       "49                                467.62   \n",
       "50                                467.62   \n",
       "51                                467.62   \n",
       "\n",
       "    General_government_net_lending_borrowing  \\\n",
       "47                                      2.17   \n",
       "48                                      2.17   \n",
       "49                                      2.17   \n",
       "50                                      2.17   \n",
       "51                                      2.17   \n",
       "\n",
       "    General_government_structural_balance  \\\n",
       "47                                    NaN   \n",
       "48                                    NaN   \n",
       "49                                    NaN   \n",
       "50                                    NaN   \n",
       "51                                    NaN   \n",
       "\n",
       "    General_government_primary_net_lending_borrowing  \\\n",
       "47                                             2.532   \n",
       "48                                             2.532   \n",
       "49                                             2.532   \n",
       "50                                             2.532   \n",
       "51                                             2.532   \n",
       "\n",
       "    General_government_net_debt  General_government_gross_debt  \\\n",
       "47                          NaN                        101.669   \n",
       "48                          NaN                        101.669   \n",
       "49                          NaN                        101.669   \n",
       "50                          NaN                        101.669   \n",
       "51                          NaN                        101.669   \n",
       "\n",
       "    Gross_domestic_product_corresponding_to_fiscal_year__current_prices  \\\n",
       "47                                            1692.57                     \n",
       "48                                            1692.57                     \n",
       "49                                            1692.57                     \n",
       "50                                            1692.57                     \n",
       "51                                            1692.57                     \n",
       "\n",
       "    Current_account_balance  LifeExpectancy         pop  density  medianage  \\\n",
       "47                    0.425            64.5  38928346.0     60.0       18.0   \n",
       "48                    0.425            64.5  38928346.0     60.0       18.0   \n",
       "49                    0.425            64.5  38928346.0     60.0       18.0   \n",
       "50                    0.425            64.5  38928346.0     60.0       18.0   \n",
       "51                    0.425            64.5  38928346.0     60.0       18.0   \n",
       "\n",
       "    urbanpop quarantine schools  hospibed  smokers  sex0  sex14  sex25  sex54  \\\n",
       "47      25.0        NaN     NaN       0.5      NaN  1.05   1.03   1.03   1.03   \n",
       "48      25.0        NaN     NaN       0.5      NaN  1.05   1.03   1.03   1.03   \n",
       "49      25.0        NaN     NaN       0.5      NaN  1.05   1.03   1.03   1.03   \n",
       "50      25.0        NaN     NaN       0.5      NaN  1.05   1.03   1.03   1.03   \n",
       "51      25.0        NaN     NaN       0.5      NaN  1.05   1.03   1.03   1.03   \n",
       "\n",
       "    sex64  sex65plus  sexratio   lung  femalelung  malelung  id  \\\n",
       "47   0.97       0.85      1.03  37.62       36.31     39.33  47   \n",
       "48   0.97       0.85      1.03  37.62       36.31     39.33  48   \n",
       "49   0.97       0.85      1.03  37.62       36.31     39.33  49   \n",
       "50   0.97       0.85      1.03  37.62       36.31     39.33  63   \n",
       "51   0.97       0.85      1.03  37.62       36.31     39.33  64   \n",
       "\n",
       "    Country/Region_le  Province/State_le  cases/day-(1-1)  cases/day-(1-7)  \\\n",
       "47                 23                  0     3.000000e+00     4.285714e-01   \n",
       "48                 23                  0     0.000000e+00     4.285714e-01   \n",
       "49                 23                  0     1.000000e+00     5.714286e-01   \n",
       "50                 23                  0     2.000000e+00     8.571429e-01   \n",
       "51                 23                  0    -9.223372e+18    -1.317625e+18   \n",
       "\n",
       "    cases/day-(8-14)  cases/day-(15-21)  fatal/day-(1-1)  fatal/day-(1-7)  \\\n",
       "47          0.142857           0.000000     0.000000e+00     0.000000e+00   \n",
       "48          0.000000           0.142857     0.000000e+00     0.000000e+00   \n",
       "49          0.000000           0.142857     0.000000e+00     0.000000e+00   \n",
       "50          0.000000           0.142857     0.000000e+00     0.000000e+00   \n",
       "51          0.000000           0.142857    -9.223372e+18    -1.317625e+18   \n",
       "\n",
       "    fatal/day-(8-14)  fatal/day-(15-21)  days_since_1cases  \\\n",
       "47               0.0                0.0                 14   \n",
       "48               0.0                0.0                 15   \n",
       "49               0.0                0.0                 16   \n",
       "50               0.0                0.0                 17   \n",
       "51               0.0                0.0                 18   \n",
       "\n",
       "    days_since_10cases  days_since_100cases  days_since_1fatal  \\\n",
       "47                   0                    0                  0   \n",
       "48                   0                    0                  0   \n",
       "49                   0                    0                  0   \n",
       "50                   0                    0                  0   \n",
       "51                   1                    1                  1   \n",
       "\n",
       "    days_since_10fatal  days_since_100fatal  \n",
       "47                   0                    0  \n",
       "48                   0                    0  \n",
       "49                   0                    0  \n",
       "50                   0                    0  \n",
       "51                   1                    1  "
      ]
     },
     "execution_count": 200,
     "metadata": {},
     "output_type": "execute_result"
    }
   ],
   "source": [
    "df_tmp = df_traintest8[(df_traintest8['day']<72) | (pd.isna(df_traintest8['ForecastId'])==False)].reset_index(drop=True)\n",
    "################################删除之前聚合的数据项\n",
    "df_tmp = df_tmp.drop([\n",
    "    'cases/day-(1-1)', 'cases/day-(1-7)', 'cases/day-(8-14)', 'cases/day-(15-21)', \n",
    "    'fatal/day-(1-1)', 'fatal/day-(1-7)', 'fatal/day-(8-14)', 'fatal/day-(15-21)',\n",
    "    'days_since_1cases', 'days_since_10cases', 'days_since_100cases',\n",
    "    'days_since_1fatal', 'days_since_10fatal', 'days_since_100fatal',\n",
    "                               ],  axis=1)\n",
    "df_traintest9 = []\n",
    "######重新聚合\n",
    "for i, place in enumerate(places[:]):\n",
    "    df_tmp2 = df_tmp[df_tmp['place_id']==place].reset_index(drop=True)\n",
    "    df_tmp2 = do_aggregations(df_tmp2)\n",
    "    df_traintest9.append(df_tmp2)\n",
    "df_traintest9 = pd.concat(df_traintest9).reset_index(drop=True)\n",
    "df_traintest9[df_traintest9['day']>68].head()"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 201,
   "metadata": {},
   "outputs": [],
   "source": [
    "########################怎么说呢，训练集很准，到真正测试集合上就不行了\n",
    "import seaborn as sns#################这是我们以前python学过的包"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 202,
   "metadata": {},
   "outputs": [
    {
     "name": "stderr",
     "output_type": "stream",
     "text": [
      "F:\\Anaconda\\lib\\site-packages\\ipykernel_launcher.py:13: SettingWithCopyWarning: \n",
      "A value is trying to be set on a copy of a slice from a DataFrame\n",
      "\n",
      "See the caveats in the documentation: https://pandas.pydata.org/pandas-docs/stable/user_guide/indexing.html#returning-a-view-versus-a-copy\n",
      "  del sys.path[0]\n",
      "F:\\Anaconda\\lib\\site-packages\\ipykernel_launcher.py:14: SettingWithCopyWarning: \n",
      "A value is trying to be set on a copy of a slice from a DataFrame\n",
      "\n",
      "See the caveats in the documentation: https://pandas.pydata.org/pandas-docs/stable/user_guide/indexing.html#returning-a-view-versus-a-copy\n",
      "  \n",
      "F:\\Anaconda\\lib\\site-packages\\ipykernel_launcher.py:22: SettingWithCopyWarning: \n",
      "A value is trying to be set on a copy of a slice from a DataFrame\n",
      "\n",
      "See the caveats in the documentation: https://pandas.pydata.org/pandas-docs/stable/user_guide/indexing.html#returning-a-view-versus-a-copy\n",
      "F:\\Anaconda\\lib\\site-packages\\ipykernel_launcher.py:23: SettingWithCopyWarning: \n",
      "A value is trying to be set on a copy of a slice from a DataFrame\n",
      "\n",
      "See the caveats in the documentation: https://pandas.pydata.org/pandas-docs/stable/user_guide/indexing.html#returning-a-view-versus-a-copy\n",
      "F:\\Anaconda\\lib\\site-packages\\lightgbm\\basic.py:497: UserWarning: Converting data to scipy sparse matrix.\n",
      "  warnings.warn('Converting data to scipy sparse matrix.')\n",
      "F:\\Anaconda\\lib\\site-packages\\ipykernel_launcher.py:33: SettingWithCopyWarning: \n",
      "A value is trying to be set on a copy of a slice from a DataFrame\n",
      "\n",
      "See the caveats in the documentation: https://pandas.pydata.org/pandas-docs/stable/user_guide/indexing.html#returning-a-view-versus-a-copy\n",
      "F:\\Anaconda\\lib\\site-packages\\ipykernel_launcher.py:34: SettingWithCopyWarning: \n",
      "A value is trying to be set on a copy of a slice from a DataFrame\n",
      "\n",
      "See the caveats in the documentation: https://pandas.pydata.org/pandas-docs/stable/user_guide/indexing.html#returning-a-view-versus-a-copy\n",
      "F:\\Anaconda\\lib\\site-packages\\ipykernel_launcher.py:35: SettingWithCopyWarning: \n",
      "A value is trying to be set on a copy of a slice from a DataFrame\n",
      "\n",
      "See the caveats in the documentation: https://pandas.pydata.org/pandas-docs/stable/user_guide/indexing.html#returning-a-view-versus-a-copy\n",
      "F:\\Anaconda\\lib\\site-packages\\ipykernel_launcher.py:36: SettingWithCopyWarning: \n",
      "A value is trying to be set on a copy of a slice from a DataFrame\n",
      "\n",
      "See the caveats in the documentation: https://pandas.pydata.org/pandas-docs/stable/user_guide/indexing.html#returning-a-view-versus-a-copy\n",
      "F:\\Anaconda\\lib\\site-packages\\ipykernel_launcher.py:6: SettingWithCopyWarning: \n",
      "A value is trying to be set on a copy of a slice from a DataFrame\n",
      "\n",
      "See the caveats in the documentation: https://pandas.pydata.org/pandas-docs/stable/user_guide/indexing.html#returning-a-view-versus-a-copy\n",
      "  \n",
      "F:\\Anaconda\\lib\\site-packages\\ipykernel_launcher.py:7: SettingWithCopyWarning: \n",
      "A value is trying to be set on a copy of a slice from a DataFrame\n",
      "\n",
      "See the caveats in the documentation: https://pandas.pydata.org/pandas-docs/stable/user_guide/indexing.html#returning-a-view-versus-a-copy\n",
      "  import sys\n"
     ]
    },
    {
     "name": "stdout",
     "output_type": "stream",
     "text": [
      "len train: 50, len prediction: 43\n",
      "63 [ 0.  0.  0.  0.  0.  0.  0.  0.  0.  0.  0.  0.  0.  0.  0.  0.  0.  0.\n",
      "  0.  0.  0.  0.  0.  0.  0.  0.  0.  0.  0.  0.  0.  0.  0.  1.  1.  1.\n",
      "  1.  1.  1.  1.  1.  1.  1.  1.  1.  1.  4.  4.  5.  7.  7.  7. 11. 16.\n",
      " 21. 22. 22. 22. 24. 24. 40. 40. 74.]\n",
      "Afghanistan\n"
     ]
    },
    {
     "data": {
      "image/png": "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\n",
      "text/plain": [
       "<Figure size 432x288 with 1 Axes>"
      ]
     },
     "metadata": {
      "needs_background": "light"
     },
     "output_type": "display_data"
    }
   ],
   "source": [
    "###############注意啊，这是什么模型的曲线?\n",
    "#############这当然是确诊数目的曲线，但是确诊我训练了两个模型\n",
    "########这是哪个模型？\n",
    "#########这是我们拟合72天内的模型啊\n",
    "##########可以看到72天内效果及其优秀，72天后呵呵\n",
    "place = 'Afghanistan'\n",
    "df_interest_base = df_traintest9[df_traintest9['place_id']==place].reset_index(drop=True)\n",
    "df_interest = copy.deepcopy(df_interest_base)\n",
    "df_interest['ConfirmedCases'] = df_interest['ConfirmedCases'].astype(np.float)\n",
    "df_interest['cases/day'] = df_interest['cases/day'].astype(np.float)\n",
    "df_interest['fatal/day'] = df_interest['fatal/day'].astype(np.float)\n",
    "df_interest['Fatalities'] = df_interest['Fatalities'].astype(np.float)\n",
    "df_interest['cases/day'][df_interest['day']>=72] = -1\n",
    "df_interest['fatal/day'][df_interest['day']>=72] = -1\n",
    "len_known = (df_interest['cases/day']!=-1).sum()\n",
    "len_unknown = (df_interest['cases/day']==-1).sum()\n",
    "print(\"len train: {}, len prediction: {}\".format(len_known, len_unknown))\n",
    "X_valid = df_interest[col_var][df_interest['day']>=72]\n",
    "X_valid2 = df_interest[col_var2][df_interest['day']>=72]\n",
    "pred_f =  np.exp(model.predict(X_valid))-1\n",
    "pred_c = np.exp(model2.predict(X_valid2))-1\n",
    "df_interest['fatal/day'][df_interest['day']>=72] = pred_f.clip(0, 1e10)\n",
    "df_interest['cases/day'][df_interest['day']>=72] = pred_c.clip(0, 1e10)\n",
    "df_interest['Fatalities'] = np.cumsum(df_interest['fatal/day'].values)\n",
    "df_interest['ConfirmedCases'] = np.cumsum(df_interest['cases/day'].values)\n",
    "for j in range(len_unknown): # use predicted cases and fatal for next days' prediction\n",
    "    X_valid = df_interest[col_var].iloc[j+len_known]\n",
    "    X_valid2 = df_interest[col_var2].iloc[j+len_known]\n",
    "    pred_f = model.predict(X_valid)\n",
    "    pred_c = model2.predict(X_valid2)\n",
    "    pred_c = (np.exp(pred_c)-1).clip(0, 1e10)\n",
    "    pred_f = (np.exp(pred_f)-1).clip(0, 1e10)\n",
    "    df_interest['fatal/day'][j+len_known] = pred_f\n",
    "    df_interest['cases/day'][j+len_known] = pred_c\n",
    "    df_interest['Fatalities'][j+len_known] = df_interest['Fatalities'][j+len_known-1] + pred_f\n",
    "    df_interest['ConfirmedCases'][j+len_known] = df_interest['ConfirmedCases'][j+len_known-1] + pred_c\n",
    "    df_interest = df_interest.drop([\n",
    "        'cases/day-(1-1)', 'cases/day-(1-7)', 'cases/day-(8-14)', 'cases/day-(15-21)', \n",
    "        'fatal/day-(1-1)', 'fatal/day-(1-7)', 'fatal/day-(8-14)', 'fatal/day-(15-21)', \n",
    "        'days_since_1cases', 'days_since_10cases', 'days_since_100cases',\n",
    "        'days_since_1fatal', 'days_since_10fatal', 'days_since_100fatal',], axis=1)\n",
    "    df_interest = do_aggregations(df_interest.reset_index(drop=True))\n",
    "# visualize\n",
    "tmp = df_interest['cases/day'].values\n",
    "tmp = np.cumsum(tmp)\n",
    "sns.lineplot(x=df_interest_base['day'], y=tmp, label='pred')\n",
    "tmp = df_traintest8['ConfirmedCases'][(df_traintest8['place_id']==place)& (pd.isna(df_traintest8['ForecastId']))].values\n",
    "print(len(tmp), tmp)\n",
    "sns.lineplot(x=df_traintest8['day'][(df_traintest8['place_id']==place)& (pd.isna(df_traintest8['ForecastId']))].values,\n",
    "             y=tmp, label='true')\n",
    "print(place)\n",
    "plt.show()"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 209,
   "metadata": {},
   "outputs": [
    {
     "data": {
      "text/html": [
       "<div>\n",
       "<style scoped>\n",
       "    .dataframe tbody tr th:only-of-type {\n",
       "        vertical-align: middle;\n",
       "    }\n",
       "\n",
       "    .dataframe tbody tr th {\n",
       "        vertical-align: top;\n",
       "    }\n",
       "\n",
       "    .dataframe thead th {\n",
       "        text-align: right;\n",
       "    }\n",
       "</style>\n",
       "<table border=\"1\" class=\"dataframe\">\n",
       "  <thead>\n",
       "    <tr style=\"text-align: right;\">\n",
       "      <th></th>\n",
       "      <th>Id</th>\n",
       "      <th>Province/State</th>\n",
       "      <th>Country/Region</th>\n",
       "      <th>Lat</th>\n",
       "      <th>Long</th>\n",
       "      <th>Date</th>\n",
       "      <th>ConfirmedCases</th>\n",
       "      <th>Fatalities</th>\n",
       "      <th>ForecastId</th>\n",
       "      <th>place_id</th>\n",
       "      <th>day</th>\n",
       "      <th>cases/day</th>\n",
       "      <th>fatal/day</th>\n",
       "      <th>SmokingRate</th>\n",
       "      <th>Country</th>\n",
       "      <th>Gross_domestic_product__constant_prices</th>\n",
       "      <th>Gross_domestic_product__current_prices</th>\n",
       "      <th>Gross_domestic_product__deflator</th>\n",
       "      <th>Gross_domestic_product_per_capita__constant_prices</th>\n",
       "      <th>Gross_domestic_product_per_capita__current_prices</th>\n",
       "      <th>Output_gap_in_percent_of_potential_GDP</th>\n",
       "      <th>Gross_domestic_product_based_on_purchasing_power_parity__PPP__valuation_of_country_GDP</th>\n",
       "      <th>Gross_domestic_product_based_on_purchasing_power_parity__PPP__per_capita_GDP</th>\n",
       "      <th>Gross_domestic_product_based_on_purchasing_power_parity__PPP__share_of_world_total</th>\n",
       "      <th>Implied_PPP_conversion_rate</th>\n",
       "      <th>Total_investment</th>\n",
       "      <th>Gross_national_savings</th>\n",
       "      <th>Inflation__average_consumer_prices</th>\n",
       "      <th>Inflation__end_of_period_consumer_prices</th>\n",
       "      <th>Six_month_London_interbank_offered_rate__LIBOR_</th>\n",
       "      <th>Volume_of_imports_of_goods_and_services</th>\n",
       "      <th>Volume_of_Imports_of_goods</th>\n",
       "      <th>Volume_of_exports_of_goods_and_services</th>\n",
       "      <th>Volume_of_exports_of_goods</th>\n",
       "      <th>Unemployment_rate</th>\n",
       "      <th>Employment</th>\n",
       "      <th>Population</th>\n",
       "      <th>General_government_revenue</th>\n",
       "      <th>General_government_total_expenditure</th>\n",
       "      <th>General_government_net_lending_borrowing</th>\n",
       "      <th>General_government_structural_balance</th>\n",
       "      <th>General_government_primary_net_lending_borrowing</th>\n",
       "      <th>General_government_net_debt</th>\n",
       "      <th>General_government_gross_debt</th>\n",
       "      <th>Gross_domestic_product_corresponding_to_fiscal_year__current_prices</th>\n",
       "      <th>Current_account_balance</th>\n",
       "      <th>LifeExpectancy</th>\n",
       "      <th>pop</th>\n",
       "      <th>density</th>\n",
       "      <th>medianage</th>\n",
       "      <th>urbanpop</th>\n",
       "      <th>quarantine</th>\n",
       "      <th>schools</th>\n",
       "      <th>hospibed</th>\n",
       "      <th>smokers</th>\n",
       "      <th>sex0</th>\n",
       "      <th>sex14</th>\n",
       "      <th>sex25</th>\n",
       "      <th>sex54</th>\n",
       "      <th>sex64</th>\n",
       "      <th>sex65plus</th>\n",
       "      <th>sexratio</th>\n",
       "      <th>lung</th>\n",
       "      <th>femalelung</th>\n",
       "      <th>malelung</th>\n",
       "      <th>id</th>\n",
       "      <th>Country/Region_le</th>\n",
       "      <th>Province/State_le</th>\n",
       "      <th>cases/day-(1-1)</th>\n",
       "      <th>cases/day-(1-7)</th>\n",
       "      <th>cases/day-(8-14)</th>\n",
       "      <th>cases/day-(15-21)</th>\n",
       "      <th>fatal/day-(1-1)</th>\n",
       "      <th>fatal/day-(1-7)</th>\n",
       "      <th>fatal/day-(8-14)</th>\n",
       "      <th>fatal/day-(15-21)</th>\n",
       "      <th>days_since_1cases</th>\n",
       "      <th>days_since_10cases</th>\n",
       "      <th>days_since_100cases</th>\n",
       "      <th>days_since_1fatal</th>\n",
       "      <th>days_since_10fatal</th>\n",
       "      <th>days_since_100fatal</th>\n",
       "    </tr>\n",
       "  </thead>\n",
       "  <tbody>\n",
       "    <tr>\n",
       "      <th>69</th>\n",
       "      <td>NaN</td>\n",
       "      <td>nan</td>\n",
       "      <td>Afghanistan</td>\n",
       "      <td>33.0</td>\n",
       "      <td>65.0</td>\n",
       "      <td>2020-03-31</td>\n",
       "      <td>22.733279</td>\n",
       "      <td>1.044000</td>\n",
       "      <td>20.0</td>\n",
       "      <td>Afghanistan</td>\n",
       "      <td>91</td>\n",
       "      <td>0.587366</td>\n",
       "      <td>0.05456</td>\n",
       "      <td>20.475517</td>\n",
       "      <td>Afghanistan</td>\n",
       "      <td>528.154</td>\n",
       "      <td>1692.57</td>\n",
       "      <td>320.469</td>\n",
       "      <td>14300.19</td>\n",
       "      <td>45827.64</td>\n",
       "      <td>NaN</td>\n",
       "      <td>75.87</td>\n",
       "      <td>2054.23</td>\n",
       "      <td>0.053</td>\n",
       "      <td>22.309</td>\n",
       "      <td>18.346</td>\n",
       "      <td>20.174</td>\n",
       "      <td>124.809</td>\n",
       "      <td>131.29</td>\n",
       "      <td>NaN</td>\n",
       "      <td>3.559</td>\n",
       "      <td>2.773</td>\n",
       "      <td>13.252</td>\n",
       "      <td>17.026</td>\n",
       "      <td>NaN</td>\n",
       "      <td>NaN</td>\n",
       "      <td>36.933</td>\n",
       "      <td>469.79</td>\n",
       "      <td>467.62</td>\n",
       "      <td>2.17</td>\n",
       "      <td>NaN</td>\n",
       "      <td>2.532</td>\n",
       "      <td>NaN</td>\n",
       "      <td>101.669</td>\n",
       "      <td>1692.57</td>\n",
       "      <td>0.425</td>\n",
       "      <td>64.5</td>\n",
       "      <td>38928346.0</td>\n",
       "      <td>60.0</td>\n",
       "      <td>18.0</td>\n",
       "      <td>25.0</td>\n",
       "      <td>NaN</td>\n",
       "      <td>NaN</td>\n",
       "      <td>0.5</td>\n",
       "      <td>NaN</td>\n",
       "      <td>1.05</td>\n",
       "      <td>1.03</td>\n",
       "      <td>1.03</td>\n",
       "      <td>1.03</td>\n",
       "      <td>0.97</td>\n",
       "      <td>0.85</td>\n",
       "      <td>1.03</td>\n",
       "      <td>37.62</td>\n",
       "      <td>36.31</td>\n",
       "      <td>39.33</td>\n",
       "      <td>82</td>\n",
       "      <td>23</td>\n",
       "      <td>0</td>\n",
       "      <td>0.587366</td>\n",
       "      <td>0.752590</td>\n",
       "      <td>0.827440</td>\n",
       "      <td>1.012243</td>\n",
       "      <td>0.05456</td>\n",
       "      <td>0.05456</td>\n",
       "      <td>0.05456</td>\n",
       "      <td>0.032229</td>\n",
       "      <td>36</td>\n",
       "      <td>16</td>\n",
       "      <td>0</td>\n",
       "      <td>0</td>\n",
       "      <td>0</td>\n",
       "      <td>0</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>70</th>\n",
       "      <td>NaN</td>\n",
       "      <td>nan</td>\n",
       "      <td>Afghanistan</td>\n",
       "      <td>33.0</td>\n",
       "      <td>65.0</td>\n",
       "      <td>2020-04-01</td>\n",
       "      <td>23.320644</td>\n",
       "      <td>1.098560</td>\n",
       "      <td>21.0</td>\n",
       "      <td>Afghanistan</td>\n",
       "      <td>92</td>\n",
       "      <td>0.587366</td>\n",
       "      <td>0.05456</td>\n",
       "      <td>20.475517</td>\n",
       "      <td>Afghanistan</td>\n",
       "      <td>528.154</td>\n",
       "      <td>1692.57</td>\n",
       "      <td>320.469</td>\n",
       "      <td>14300.19</td>\n",
       "      <td>45827.64</td>\n",
       "      <td>NaN</td>\n",
       "      <td>75.87</td>\n",
       "      <td>2054.23</td>\n",
       "      <td>0.053</td>\n",
       "      <td>22.309</td>\n",
       "      <td>18.346</td>\n",
       "      <td>20.174</td>\n",
       "      <td>124.809</td>\n",
       "      <td>131.29</td>\n",
       "      <td>NaN</td>\n",
       "      <td>3.559</td>\n",
       "      <td>2.773</td>\n",
       "      <td>13.252</td>\n",
       "      <td>17.026</td>\n",
       "      <td>NaN</td>\n",
       "      <td>NaN</td>\n",
       "      <td>36.933</td>\n",
       "      <td>469.79</td>\n",
       "      <td>467.62</td>\n",
       "      <td>2.17</td>\n",
       "      <td>NaN</td>\n",
       "      <td>2.532</td>\n",
       "      <td>NaN</td>\n",
       "      <td>101.669</td>\n",
       "      <td>1692.57</td>\n",
       "      <td>0.425</td>\n",
       "      <td>64.5</td>\n",
       "      <td>38928346.0</td>\n",
       "      <td>60.0</td>\n",
       "      <td>18.0</td>\n",
       "      <td>25.0</td>\n",
       "      <td>NaN</td>\n",
       "      <td>NaN</td>\n",
       "      <td>0.5</td>\n",
       "      <td>NaN</td>\n",
       "      <td>1.05</td>\n",
       "      <td>1.03</td>\n",
       "      <td>1.03</td>\n",
       "      <td>1.03</td>\n",
       "      <td>0.97</td>\n",
       "      <td>0.85</td>\n",
       "      <td>1.03</td>\n",
       "      <td>37.62</td>\n",
       "      <td>36.31</td>\n",
       "      <td>39.33</td>\n",
       "      <td>83</td>\n",
       "      <td>23</td>\n",
       "      <td>0</td>\n",
       "      <td>0.587366</td>\n",
       "      <td>0.725053</td>\n",
       "      <td>0.829316</td>\n",
       "      <td>0.978957</td>\n",
       "      <td>0.05456</td>\n",
       "      <td>0.05456</td>\n",
       "      <td>0.05456</td>\n",
       "      <td>0.040024</td>\n",
       "      <td>37</td>\n",
       "      <td>17</td>\n",
       "      <td>0</td>\n",
       "      <td>1</td>\n",
       "      <td>0</td>\n",
       "      <td>0</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>71</th>\n",
       "      <td>NaN</td>\n",
       "      <td>nan</td>\n",
       "      <td>Afghanistan</td>\n",
       "      <td>33.0</td>\n",
       "      <td>65.0</td>\n",
       "      <td>2020-04-02</td>\n",
       "      <td>23.908010</td>\n",
       "      <td>1.153119</td>\n",
       "      <td>22.0</td>\n",
       "      <td>Afghanistan</td>\n",
       "      <td>93</td>\n",
       "      <td>0.587366</td>\n",
       "      <td>0.05456</td>\n",
       "      <td>20.475517</td>\n",
       "      <td>Afghanistan</td>\n",
       "      <td>528.154</td>\n",
       "      <td>1692.57</td>\n",
       "      <td>320.469</td>\n",
       "      <td>14300.19</td>\n",
       "      <td>45827.64</td>\n",
       "      <td>NaN</td>\n",
       "      <td>75.87</td>\n",
       "      <td>2054.23</td>\n",
       "      <td>0.053</td>\n",
       "      <td>22.309</td>\n",
       "      <td>18.346</td>\n",
       "      <td>20.174</td>\n",
       "      <td>124.809</td>\n",
       "      <td>131.29</td>\n",
       "      <td>NaN</td>\n",
       "      <td>3.559</td>\n",
       "      <td>2.773</td>\n",
       "      <td>13.252</td>\n",
       "      <td>17.026</td>\n",
       "      <td>NaN</td>\n",
       "      <td>NaN</td>\n",
       "      <td>36.933</td>\n",
       "      <td>469.79</td>\n",
       "      <td>467.62</td>\n",
       "      <td>2.17</td>\n",
       "      <td>NaN</td>\n",
       "      <td>2.532</td>\n",
       "      <td>NaN</td>\n",
       "      <td>101.669</td>\n",
       "      <td>1692.57</td>\n",
       "      <td>0.425</td>\n",
       "      <td>64.5</td>\n",
       "      <td>38928346.0</td>\n",
       "      <td>60.0</td>\n",
       "      <td>18.0</td>\n",
       "      <td>25.0</td>\n",
       "      <td>NaN</td>\n",
       "      <td>NaN</td>\n",
       "      <td>0.5</td>\n",
       "      <td>NaN</td>\n",
       "      <td>1.05</td>\n",
       "      <td>1.03</td>\n",
       "      <td>1.03</td>\n",
       "      <td>1.03</td>\n",
       "      <td>0.97</td>\n",
       "      <td>0.85</td>\n",
       "      <td>1.03</td>\n",
       "      <td>37.62</td>\n",
       "      <td>36.31</td>\n",
       "      <td>39.33</td>\n",
       "      <td>84</td>\n",
       "      <td>23</td>\n",
       "      <td>0</td>\n",
       "      <td>0.587366</td>\n",
       "      <td>0.697516</td>\n",
       "      <td>0.826322</td>\n",
       "      <td>0.807683</td>\n",
       "      <td>0.05456</td>\n",
       "      <td>0.05456</td>\n",
       "      <td>0.05456</td>\n",
       "      <td>0.047818</td>\n",
       "      <td>38</td>\n",
       "      <td>18</td>\n",
       "      <td>0</td>\n",
       "      <td>2</td>\n",
       "      <td>0</td>\n",
       "      <td>0</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>72</th>\n",
       "      <td>NaN</td>\n",
       "      <td>nan</td>\n",
       "      <td>Afghanistan</td>\n",
       "      <td>33.0</td>\n",
       "      <td>65.0</td>\n",
       "      <td>2020-04-03</td>\n",
       "      <td>24.495376</td>\n",
       "      <td>1.207679</td>\n",
       "      <td>23.0</td>\n",
       "      <td>Afghanistan</td>\n",
       "      <td>94</td>\n",
       "      <td>0.587366</td>\n",
       "      <td>0.05456</td>\n",
       "      <td>20.475517</td>\n",
       "      <td>Afghanistan</td>\n",
       "      <td>528.154</td>\n",
       "      <td>1692.57</td>\n",
       "      <td>320.469</td>\n",
       "      <td>14300.19</td>\n",
       "      <td>45827.64</td>\n",
       "      <td>NaN</td>\n",
       "      <td>75.87</td>\n",
       "      <td>2054.23</td>\n",
       "      <td>0.053</td>\n",
       "      <td>22.309</td>\n",
       "      <td>18.346</td>\n",
       "      <td>20.174</td>\n",
       "      <td>124.809</td>\n",
       "      <td>131.29</td>\n",
       "      <td>NaN</td>\n",
       "      <td>3.559</td>\n",
       "      <td>2.773</td>\n",
       "      <td>13.252</td>\n",
       "      <td>17.026</td>\n",
       "      <td>NaN</td>\n",
       "      <td>NaN</td>\n",
       "      <td>36.933</td>\n",
       "      <td>469.79</td>\n",
       "      <td>467.62</td>\n",
       "      <td>2.17</td>\n",
       "      <td>NaN</td>\n",
       "      <td>2.532</td>\n",
       "      <td>NaN</td>\n",
       "      <td>101.669</td>\n",
       "      <td>1692.57</td>\n",
       "      <td>0.425</td>\n",
       "      <td>64.5</td>\n",
       "      <td>38928346.0</td>\n",
       "      <td>60.0</td>\n",
       "      <td>18.0</td>\n",
       "      <td>25.0</td>\n",
       "      <td>NaN</td>\n",
       "      <td>NaN</td>\n",
       "      <td>0.5</td>\n",
       "      <td>NaN</td>\n",
       "      <td>1.05</td>\n",
       "      <td>1.03</td>\n",
       "      <td>1.03</td>\n",
       "      <td>1.03</td>\n",
       "      <td>0.97</td>\n",
       "      <td>0.85</td>\n",
       "      <td>1.03</td>\n",
       "      <td>37.62</td>\n",
       "      <td>36.31</td>\n",
       "      <td>39.33</td>\n",
       "      <td>85</td>\n",
       "      <td>23</td>\n",
       "      <td>0</td>\n",
       "      <td>0.587366</td>\n",
       "      <td>0.669978</td>\n",
       "      <td>0.814773</td>\n",
       "      <td>0.802521</td>\n",
       "      <td>0.05456</td>\n",
       "      <td>0.05456</td>\n",
       "      <td>0.05456</td>\n",
       "      <td>0.054560</td>\n",
       "      <td>39</td>\n",
       "      <td>19</td>\n",
       "      <td>0</td>\n",
       "      <td>3</td>\n",
       "      <td>0</td>\n",
       "      <td>0</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>73</th>\n",
       "      <td>NaN</td>\n",
       "      <td>nan</td>\n",
       "      <td>Afghanistan</td>\n",
       "      <td>33.0</td>\n",
       "      <td>65.0</td>\n",
       "      <td>2020-04-04</td>\n",
       "      <td>25.082742</td>\n",
       "      <td>1.262238</td>\n",
       "      <td>24.0</td>\n",
       "      <td>Afghanistan</td>\n",
       "      <td>95</td>\n",
       "      <td>0.587366</td>\n",
       "      <td>0.05456</td>\n",
       "      <td>20.475517</td>\n",
       "      <td>Afghanistan</td>\n",
       "      <td>528.154</td>\n",
       "      <td>1692.57</td>\n",
       "      <td>320.469</td>\n",
       "      <td>14300.19</td>\n",
       "      <td>45827.64</td>\n",
       "      <td>NaN</td>\n",
       "      <td>75.87</td>\n",
       "      <td>2054.23</td>\n",
       "      <td>0.053</td>\n",
       "      <td>22.309</td>\n",
       "      <td>18.346</td>\n",
       "      <td>20.174</td>\n",
       "      <td>124.809</td>\n",
       "      <td>131.29</td>\n",
       "      <td>NaN</td>\n",
       "      <td>3.559</td>\n",
       "      <td>2.773</td>\n",
       "      <td>13.252</td>\n",
       "      <td>17.026</td>\n",
       "      <td>NaN</td>\n",
       "      <td>NaN</td>\n",
       "      <td>36.933</td>\n",
       "      <td>469.79</td>\n",
       "      <td>467.62</td>\n",
       "      <td>2.17</td>\n",
       "      <td>NaN</td>\n",
       "      <td>2.532</td>\n",
       "      <td>NaN</td>\n",
       "      <td>101.669</td>\n",
       "      <td>1692.57</td>\n",
       "      <td>0.425</td>\n",
       "      <td>64.5</td>\n",
       "      <td>38928346.0</td>\n",
       "      <td>60.0</td>\n",
       "      <td>18.0</td>\n",
       "      <td>25.0</td>\n",
       "      <td>NaN</td>\n",
       "      <td>NaN</td>\n",
       "      <td>0.5</td>\n",
       "      <td>NaN</td>\n",
       "      <td>1.05</td>\n",
       "      <td>1.03</td>\n",
       "      <td>1.03</td>\n",
       "      <td>1.03</td>\n",
       "      <td>0.97</td>\n",
       "      <td>0.85</td>\n",
       "      <td>1.03</td>\n",
       "      <td>37.62</td>\n",
       "      <td>36.31</td>\n",
       "      <td>39.33</td>\n",
       "      <td>86</td>\n",
       "      <td>23</td>\n",
       "      <td>0</td>\n",
       "      <td>0.587366</td>\n",
       "      <td>0.642441</td>\n",
       "      <td>0.803225</td>\n",
       "      <td>0.814934</td>\n",
       "      <td>0.05456</td>\n",
       "      <td>0.05456</td>\n",
       "      <td>0.05456</td>\n",
       "      <td>0.054560</td>\n",
       "      <td>40</td>\n",
       "      <td>20</td>\n",
       "      <td>0</td>\n",
       "      <td>4</td>\n",
       "      <td>0</td>\n",
       "      <td>0</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>74</th>\n",
       "      <td>NaN</td>\n",
       "      <td>nan</td>\n",
       "      <td>Afghanistan</td>\n",
       "      <td>33.0</td>\n",
       "      <td>65.0</td>\n",
       "      <td>2020-04-05</td>\n",
       "      <td>25.670108</td>\n",
       "      <td>1.316798</td>\n",
       "      <td>25.0</td>\n",
       "      <td>Afghanistan</td>\n",
       "      <td>96</td>\n",
       "      <td>0.587366</td>\n",
       "      <td>0.05456</td>\n",
       "      <td>20.475517</td>\n",
       "      <td>Afghanistan</td>\n",
       "      <td>528.154</td>\n",
       "      <td>1692.57</td>\n",
       "      <td>320.469</td>\n",
       "      <td>14300.19</td>\n",
       "      <td>45827.64</td>\n",
       "      <td>NaN</td>\n",
       "      <td>75.87</td>\n",
       "      <td>2054.23</td>\n",
       "      <td>0.053</td>\n",
       "      <td>22.309</td>\n",
       "      <td>18.346</td>\n",
       "      <td>20.174</td>\n",
       "      <td>124.809</td>\n",
       "      <td>131.29</td>\n",
       "      <td>NaN</td>\n",
       "      <td>3.559</td>\n",
       "      <td>2.773</td>\n",
       "      <td>13.252</td>\n",
       "      <td>17.026</td>\n",
       "      <td>NaN</td>\n",
       "      <td>NaN</td>\n",
       "      <td>36.933</td>\n",
       "      <td>469.79</td>\n",
       "      <td>467.62</td>\n",
       "      <td>2.17</td>\n",
       "      <td>NaN</td>\n",
       "      <td>2.532</td>\n",
       "      <td>NaN</td>\n",
       "      <td>101.669</td>\n",
       "      <td>1692.57</td>\n",
       "      <td>0.425</td>\n",
       "      <td>64.5</td>\n",
       "      <td>38928346.0</td>\n",
       "      <td>60.0</td>\n",
       "      <td>18.0</td>\n",
       "      <td>25.0</td>\n",
       "      <td>NaN</td>\n",
       "      <td>NaN</td>\n",
       "      <td>0.5</td>\n",
       "      <td>NaN</td>\n",
       "      <td>1.05</td>\n",
       "      <td>1.03</td>\n",
       "      <td>1.03</td>\n",
       "      <td>1.03</td>\n",
       "      <td>0.97</td>\n",
       "      <td>0.85</td>\n",
       "      <td>1.03</td>\n",
       "      <td>37.62</td>\n",
       "      <td>36.31</td>\n",
       "      <td>39.33</td>\n",
       "      <td>87</td>\n",
       "      <td>23</td>\n",
       "      <td>0</td>\n",
       "      <td>0.587366</td>\n",
       "      <td>0.614903</td>\n",
       "      <td>0.791676</td>\n",
       "      <td>0.820249</td>\n",
       "      <td>0.05456</td>\n",
       "      <td>0.05456</td>\n",
       "      <td>0.05456</td>\n",
       "      <td>0.054560</td>\n",
       "      <td>41</td>\n",
       "      <td>21</td>\n",
       "      <td>0</td>\n",
       "      <td>5</td>\n",
       "      <td>0</td>\n",
       "      <td>0</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>75</th>\n",
       "      <td>NaN</td>\n",
       "      <td>nan</td>\n",
       "      <td>Afghanistan</td>\n",
       "      <td>33.0</td>\n",
       "      <td>65.0</td>\n",
       "      <td>2020-04-06</td>\n",
       "      <td>26.257474</td>\n",
       "      <td>1.371358</td>\n",
       "      <td>26.0</td>\n",
       "      <td>Afghanistan</td>\n",
       "      <td>97</td>\n",
       "      <td>0.587366</td>\n",
       "      <td>0.05456</td>\n",
       "      <td>20.475517</td>\n",
       "      <td>Afghanistan</td>\n",
       "      <td>528.154</td>\n",
       "      <td>1692.57</td>\n",
       "      <td>320.469</td>\n",
       "      <td>14300.19</td>\n",
       "      <td>45827.64</td>\n",
       "      <td>NaN</td>\n",
       "      <td>75.87</td>\n",
       "      <td>2054.23</td>\n",
       "      <td>0.053</td>\n",
       "      <td>22.309</td>\n",
       "      <td>18.346</td>\n",
       "      <td>20.174</td>\n",
       "      <td>124.809</td>\n",
       "      <td>131.29</td>\n",
       "      <td>NaN</td>\n",
       "      <td>3.559</td>\n",
       "      <td>2.773</td>\n",
       "      <td>13.252</td>\n",
       "      <td>17.026</td>\n",
       "      <td>NaN</td>\n",
       "      <td>NaN</td>\n",
       "      <td>36.933</td>\n",
       "      <td>469.79</td>\n",
       "      <td>467.62</td>\n",
       "      <td>2.17</td>\n",
       "      <td>NaN</td>\n",
       "      <td>2.532</td>\n",
       "      <td>NaN</td>\n",
       "      <td>101.669</td>\n",
       "      <td>1692.57</td>\n",
       "      <td>0.425</td>\n",
       "      <td>64.5</td>\n",
       "      <td>38928346.0</td>\n",
       "      <td>60.0</td>\n",
       "      <td>18.0</td>\n",
       "      <td>25.0</td>\n",
       "      <td>NaN</td>\n",
       "      <td>NaN</td>\n",
       "      <td>0.5</td>\n",
       "      <td>NaN</td>\n",
       "      <td>1.05</td>\n",
       "      <td>1.03</td>\n",
       "      <td>1.03</td>\n",
       "      <td>1.03</td>\n",
       "      <td>0.97</td>\n",
       "      <td>0.85</td>\n",
       "      <td>1.03</td>\n",
       "      <td>37.62</td>\n",
       "      <td>36.31</td>\n",
       "      <td>39.33</td>\n",
       "      <td>88</td>\n",
       "      <td>23</td>\n",
       "      <td>0</td>\n",
       "      <td>0.587366</td>\n",
       "      <td>0.587366</td>\n",
       "      <td>0.780128</td>\n",
       "      <td>0.825564</td>\n",
       "      <td>0.05456</td>\n",
       "      <td>0.05456</td>\n",
       "      <td>0.05456</td>\n",
       "      <td>0.054560</td>\n",
       "      <td>42</td>\n",
       "      <td>22</td>\n",
       "      <td>0</td>\n",
       "      <td>6</td>\n",
       "      <td>0</td>\n",
       "      <td>0</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>76</th>\n",
       "      <td>NaN</td>\n",
       "      <td>nan</td>\n",
       "      <td>Afghanistan</td>\n",
       "      <td>33.0</td>\n",
       "      <td>65.0</td>\n",
       "      <td>2020-04-07</td>\n",
       "      <td>26.844840</td>\n",
       "      <td>1.425917</td>\n",
       "      <td>27.0</td>\n",
       "      <td>Afghanistan</td>\n",
       "      <td>98</td>\n",
       "      <td>0.587366</td>\n",
       "      <td>0.05456</td>\n",
       "      <td>20.475517</td>\n",
       "      <td>Afghanistan</td>\n",
       "      <td>528.154</td>\n",
       "      <td>1692.57</td>\n",
       "      <td>320.469</td>\n",
       "      <td>14300.19</td>\n",
       "      <td>45827.64</td>\n",
       "      <td>NaN</td>\n",
       "      <td>75.87</td>\n",
       "      <td>2054.23</td>\n",
       "      <td>0.053</td>\n",
       "      <td>22.309</td>\n",
       "      <td>18.346</td>\n",
       "      <td>20.174</td>\n",
       "      <td>124.809</td>\n",
       "      <td>131.29</td>\n",
       "      <td>NaN</td>\n",
       "      <td>3.559</td>\n",
       "      <td>2.773</td>\n",
       "      <td>13.252</td>\n",
       "      <td>17.026</td>\n",
       "      <td>NaN</td>\n",
       "      <td>NaN</td>\n",
       "      <td>36.933</td>\n",
       "      <td>469.79</td>\n",
       "      <td>467.62</td>\n",
       "      <td>2.17</td>\n",
       "      <td>NaN</td>\n",
       "      <td>2.532</td>\n",
       "      <td>NaN</td>\n",
       "      <td>101.669</td>\n",
       "      <td>1692.57</td>\n",
       "      <td>0.425</td>\n",
       "      <td>64.5</td>\n",
       "      <td>38928346.0</td>\n",
       "      <td>60.0</td>\n",
       "      <td>18.0</td>\n",
       "      <td>25.0</td>\n",
       "      <td>NaN</td>\n",
       "      <td>NaN</td>\n",
       "      <td>0.5</td>\n",
       "      <td>NaN</td>\n",
       "      <td>1.05</td>\n",
       "      <td>1.03</td>\n",
       "      <td>1.03</td>\n",
       "      <td>1.03</td>\n",
       "      <td>0.97</td>\n",
       "      <td>0.85</td>\n",
       "      <td>1.03</td>\n",
       "      <td>37.62</td>\n",
       "      <td>36.31</td>\n",
       "      <td>39.33</td>\n",
       "      <td>89</td>\n",
       "      <td>23</td>\n",
       "      <td>0</td>\n",
       "      <td>0.587366</td>\n",
       "      <td>0.587366</td>\n",
       "      <td>0.752590</td>\n",
       "      <td>0.827440</td>\n",
       "      <td>0.05456</td>\n",
       "      <td>0.05456</td>\n",
       "      <td>0.05456</td>\n",
       "      <td>0.054560</td>\n",
       "      <td>43</td>\n",
       "      <td>23</td>\n",
       "      <td>0</td>\n",
       "      <td>7</td>\n",
       "      <td>0</td>\n",
       "      <td>0</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>77</th>\n",
       "      <td>NaN</td>\n",
       "      <td>nan</td>\n",
       "      <td>Afghanistan</td>\n",
       "      <td>33.0</td>\n",
       "      <td>65.0</td>\n",
       "      <td>2020-04-08</td>\n",
       "      <td>27.432206</td>\n",
       "      <td>1.480477</td>\n",
       "      <td>28.0</td>\n",
       "      <td>Afghanistan</td>\n",
       "      <td>99</td>\n",
       "      <td>0.587366</td>\n",
       "      <td>0.05456</td>\n",
       "      <td>20.475517</td>\n",
       "      <td>Afghanistan</td>\n",
       "      <td>528.154</td>\n",
       "      <td>1692.57</td>\n",
       "      <td>320.469</td>\n",
       "      <td>14300.19</td>\n",
       "      <td>45827.64</td>\n",
       "      <td>NaN</td>\n",
       "      <td>75.87</td>\n",
       "      <td>2054.23</td>\n",
       "      <td>0.053</td>\n",
       "      <td>22.309</td>\n",
       "      <td>18.346</td>\n",
       "      <td>20.174</td>\n",
       "      <td>124.809</td>\n",
       "      <td>131.29</td>\n",
       "      <td>NaN</td>\n",
       "      <td>3.559</td>\n",
       "      <td>2.773</td>\n",
       "      <td>13.252</td>\n",
       "      <td>17.026</td>\n",
       "      <td>NaN</td>\n",
       "      <td>NaN</td>\n",
       "      <td>36.933</td>\n",
       "      <td>469.79</td>\n",
       "      <td>467.62</td>\n",
       "      <td>2.17</td>\n",
       "      <td>NaN</td>\n",
       "      <td>2.532</td>\n",
       "      <td>NaN</td>\n",
       "      <td>101.669</td>\n",
       "      <td>1692.57</td>\n",
       "      <td>0.425</td>\n",
       "      <td>64.5</td>\n",
       "      <td>38928346.0</td>\n",
       "      <td>60.0</td>\n",
       "      <td>18.0</td>\n",
       "      <td>25.0</td>\n",
       "      <td>NaN</td>\n",
       "      <td>NaN</td>\n",
       "      <td>0.5</td>\n",
       "      <td>NaN</td>\n",
       "      <td>1.05</td>\n",
       "      <td>1.03</td>\n",
       "      <td>1.03</td>\n",
       "      <td>1.03</td>\n",
       "      <td>0.97</td>\n",
       "      <td>0.85</td>\n",
       "      <td>1.03</td>\n",
       "      <td>37.62</td>\n",
       "      <td>36.31</td>\n",
       "      <td>39.33</td>\n",
       "      <td>90</td>\n",
       "      <td>23</td>\n",
       "      <td>0</td>\n",
       "      <td>0.587366</td>\n",
       "      <td>0.587366</td>\n",
       "      <td>0.725053</td>\n",
       "      <td>0.829316</td>\n",
       "      <td>0.05456</td>\n",
       "      <td>0.05456</td>\n",
       "      <td>0.05456</td>\n",
       "      <td>0.054560</td>\n",
       "      <td>44</td>\n",
       "      <td>24</td>\n",
       "      <td>0</td>\n",
       "      <td>8</td>\n",
       "      <td>0</td>\n",
       "      <td>0</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>78</th>\n",
       "      <td>NaN</td>\n",
       "      <td>nan</td>\n",
       "      <td>Afghanistan</td>\n",
       "      <td>33.0</td>\n",
       "      <td>65.0</td>\n",
       "      <td>2020-04-09</td>\n",
       "      <td>28.019571</td>\n",
       "      <td>1.535036</td>\n",
       "      <td>29.0</td>\n",
       "      <td>Afghanistan</td>\n",
       "      <td>100</td>\n",
       "      <td>0.587366</td>\n",
       "      <td>0.05456</td>\n",
       "      <td>20.475517</td>\n",
       "      <td>Afghanistan</td>\n",
       "      <td>528.154</td>\n",
       "      <td>1692.57</td>\n",
       "      <td>320.469</td>\n",
       "      <td>14300.19</td>\n",
       "      <td>45827.64</td>\n",
       "      <td>NaN</td>\n",
       "      <td>75.87</td>\n",
       "      <td>2054.23</td>\n",
       "      <td>0.053</td>\n",
       "      <td>22.309</td>\n",
       "      <td>18.346</td>\n",
       "      <td>20.174</td>\n",
       "      <td>124.809</td>\n",
       "      <td>131.29</td>\n",
       "      <td>NaN</td>\n",
       "      <td>3.559</td>\n",
       "      <td>2.773</td>\n",
       "      <td>13.252</td>\n",
       "      <td>17.026</td>\n",
       "      <td>NaN</td>\n",
       "      <td>NaN</td>\n",
       "      <td>36.933</td>\n",
       "      <td>469.79</td>\n",
       "      <td>467.62</td>\n",
       "      <td>2.17</td>\n",
       "      <td>NaN</td>\n",
       "      <td>2.532</td>\n",
       "      <td>NaN</td>\n",
       "      <td>101.669</td>\n",
       "      <td>1692.57</td>\n",
       "      <td>0.425</td>\n",
       "      <td>64.5</td>\n",
       "      <td>38928346.0</td>\n",
       "      <td>60.0</td>\n",
       "      <td>18.0</td>\n",
       "      <td>25.0</td>\n",
       "      <td>NaN</td>\n",
       "      <td>NaN</td>\n",
       "      <td>0.5</td>\n",
       "      <td>NaN</td>\n",
       "      <td>1.05</td>\n",
       "      <td>1.03</td>\n",
       "      <td>1.03</td>\n",
       "      <td>1.03</td>\n",
       "      <td>0.97</td>\n",
       "      <td>0.85</td>\n",
       "      <td>1.03</td>\n",
       "      <td>37.62</td>\n",
       "      <td>36.31</td>\n",
       "      <td>39.33</td>\n",
       "      <td>91</td>\n",
       "      <td>23</td>\n",
       "      <td>0</td>\n",
       "      <td>0.587366</td>\n",
       "      <td>0.587366</td>\n",
       "      <td>0.697516</td>\n",
       "      <td>0.826322</td>\n",
       "      <td>0.05456</td>\n",
       "      <td>0.05456</td>\n",
       "      <td>0.05456</td>\n",
       "      <td>0.054560</td>\n",
       "      <td>45</td>\n",
       "      <td>25</td>\n",
       "      <td>0</td>\n",
       "      <td>9</td>\n",
       "      <td>0</td>\n",
       "      <td>0</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>79</th>\n",
       "      <td>NaN</td>\n",
       "      <td>nan</td>\n",
       "      <td>Afghanistan</td>\n",
       "      <td>33.0</td>\n",
       "      <td>65.0</td>\n",
       "      <td>2020-04-10</td>\n",
       "      <td>28.606937</td>\n",
       "      <td>1.589596</td>\n",
       "      <td>30.0</td>\n",
       "      <td>Afghanistan</td>\n",
       "      <td>101</td>\n",
       "      <td>0.587366</td>\n",
       "      <td>0.05456</td>\n",
       "      <td>20.475517</td>\n",
       "      <td>Afghanistan</td>\n",
       "      <td>528.154</td>\n",
       "      <td>1692.57</td>\n",
       "      <td>320.469</td>\n",
       "      <td>14300.19</td>\n",
       "      <td>45827.64</td>\n",
       "      <td>NaN</td>\n",
       "      <td>75.87</td>\n",
       "      <td>2054.23</td>\n",
       "      <td>0.053</td>\n",
       "      <td>22.309</td>\n",
       "      <td>18.346</td>\n",
       "      <td>20.174</td>\n",
       "      <td>124.809</td>\n",
       "      <td>131.29</td>\n",
       "      <td>NaN</td>\n",
       "      <td>3.559</td>\n",
       "      <td>2.773</td>\n",
       "      <td>13.252</td>\n",
       "      <td>17.026</td>\n",
       "      <td>NaN</td>\n",
       "      <td>NaN</td>\n",
       "      <td>36.933</td>\n",
       "      <td>469.79</td>\n",
       "      <td>467.62</td>\n",
       "      <td>2.17</td>\n",
       "      <td>NaN</td>\n",
       "      <td>2.532</td>\n",
       "      <td>NaN</td>\n",
       "      <td>101.669</td>\n",
       "      <td>1692.57</td>\n",
       "      <td>0.425</td>\n",
       "      <td>64.5</td>\n",
       "      <td>38928346.0</td>\n",
       "      <td>60.0</td>\n",
       "      <td>18.0</td>\n",
       "      <td>25.0</td>\n",
       "      <td>NaN</td>\n",
       "      <td>NaN</td>\n",
       "      <td>0.5</td>\n",
       "      <td>NaN</td>\n",
       "      <td>1.05</td>\n",
       "      <td>1.03</td>\n",
       "      <td>1.03</td>\n",
       "      <td>1.03</td>\n",
       "      <td>0.97</td>\n",
       "      <td>0.85</td>\n",
       "      <td>1.03</td>\n",
       "      <td>37.62</td>\n",
       "      <td>36.31</td>\n",
       "      <td>39.33</td>\n",
       "      <td>92</td>\n",
       "      <td>23</td>\n",
       "      <td>0</td>\n",
       "      <td>0.587366</td>\n",
       "      <td>0.587366</td>\n",
       "      <td>0.669978</td>\n",
       "      <td>0.814773</td>\n",
       "      <td>0.05456</td>\n",
       "      <td>0.05456</td>\n",
       "      <td>0.05456</td>\n",
       "      <td>0.054560</td>\n",
       "      <td>46</td>\n",
       "      <td>26</td>\n",
       "      <td>0</td>\n",
       "      <td>10</td>\n",
       "      <td>0</td>\n",
       "      <td>0</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>80</th>\n",
       "      <td>NaN</td>\n",
       "      <td>nan</td>\n",
       "      <td>Afghanistan</td>\n",
       "      <td>33.0</td>\n",
       "      <td>65.0</td>\n",
       "      <td>2020-04-11</td>\n",
       "      <td>29.194303</td>\n",
       "      <td>1.644156</td>\n",
       "      <td>31.0</td>\n",
       "      <td>Afghanistan</td>\n",
       "      <td>102</td>\n",
       "      <td>0.587366</td>\n",
       "      <td>0.05456</td>\n",
       "      <td>20.475517</td>\n",
       "      <td>Afghanistan</td>\n",
       "      <td>528.154</td>\n",
       "      <td>1692.57</td>\n",
       "      <td>320.469</td>\n",
       "      <td>14300.19</td>\n",
       "      <td>45827.64</td>\n",
       "      <td>NaN</td>\n",
       "      <td>75.87</td>\n",
       "      <td>2054.23</td>\n",
       "      <td>0.053</td>\n",
       "      <td>22.309</td>\n",
       "      <td>18.346</td>\n",
       "      <td>20.174</td>\n",
       "      <td>124.809</td>\n",
       "      <td>131.29</td>\n",
       "      <td>NaN</td>\n",
       "      <td>3.559</td>\n",
       "      <td>2.773</td>\n",
       "      <td>13.252</td>\n",
       "      <td>17.026</td>\n",
       "      <td>NaN</td>\n",
       "      <td>NaN</td>\n",
       "      <td>36.933</td>\n",
       "      <td>469.79</td>\n",
       "      <td>467.62</td>\n",
       "      <td>2.17</td>\n",
       "      <td>NaN</td>\n",
       "      <td>2.532</td>\n",
       "      <td>NaN</td>\n",
       "      <td>101.669</td>\n",
       "      <td>1692.57</td>\n",
       "      <td>0.425</td>\n",
       "      <td>64.5</td>\n",
       "      <td>38928346.0</td>\n",
       "      <td>60.0</td>\n",
       "      <td>18.0</td>\n",
       "      <td>25.0</td>\n",
       "      <td>NaN</td>\n",
       "      <td>NaN</td>\n",
       "      <td>0.5</td>\n",
       "      <td>NaN</td>\n",
       "      <td>1.05</td>\n",
       "      <td>1.03</td>\n",
       "      <td>1.03</td>\n",
       "      <td>1.03</td>\n",
       "      <td>0.97</td>\n",
       "      <td>0.85</td>\n",
       "      <td>1.03</td>\n",
       "      <td>37.62</td>\n",
       "      <td>36.31</td>\n",
       "      <td>39.33</td>\n",
       "      <td>93</td>\n",
       "      <td>23</td>\n",
       "      <td>0</td>\n",
       "      <td>0.587366</td>\n",
       "      <td>0.587366</td>\n",
       "      <td>0.642441</td>\n",
       "      <td>0.803225</td>\n",
       "      <td>0.05456</td>\n",
       "      <td>0.05456</td>\n",
       "      <td>0.05456</td>\n",
       "      <td>0.054560</td>\n",
       "      <td>47</td>\n",
       "      <td>27</td>\n",
       "      <td>0</td>\n",
       "      <td>11</td>\n",
       "      <td>0</td>\n",
       "      <td>0</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>81</th>\n",
       "      <td>NaN</td>\n",
       "      <td>nan</td>\n",
       "      <td>Afghanistan</td>\n",
       "      <td>33.0</td>\n",
       "      <td>65.0</td>\n",
       "      <td>2020-04-12</td>\n",
       "      <td>29.781669</td>\n",
       "      <td>1.698715</td>\n",
       "      <td>32.0</td>\n",
       "      <td>Afghanistan</td>\n",
       "      <td>103</td>\n",
       "      <td>0.587366</td>\n",
       "      <td>0.05456</td>\n",
       "      <td>20.475517</td>\n",
       "      <td>Afghanistan</td>\n",
       "      <td>528.154</td>\n",
       "      <td>1692.57</td>\n",
       "      <td>320.469</td>\n",
       "      <td>14300.19</td>\n",
       "      <td>45827.64</td>\n",
       "      <td>NaN</td>\n",
       "      <td>75.87</td>\n",
       "      <td>2054.23</td>\n",
       "      <td>0.053</td>\n",
       "      <td>22.309</td>\n",
       "      <td>18.346</td>\n",
       "      <td>20.174</td>\n",
       "      <td>124.809</td>\n",
       "      <td>131.29</td>\n",
       "      <td>NaN</td>\n",
       "      <td>3.559</td>\n",
       "      <td>2.773</td>\n",
       "      <td>13.252</td>\n",
       "      <td>17.026</td>\n",
       "      <td>NaN</td>\n",
       "      <td>NaN</td>\n",
       "      <td>36.933</td>\n",
       "      <td>469.79</td>\n",
       "      <td>467.62</td>\n",
       "      <td>2.17</td>\n",
       "      <td>NaN</td>\n",
       "      <td>2.532</td>\n",
       "      <td>NaN</td>\n",
       "      <td>101.669</td>\n",
       "      <td>1692.57</td>\n",
       "      <td>0.425</td>\n",
       "      <td>64.5</td>\n",
       "      <td>38928346.0</td>\n",
       "      <td>60.0</td>\n",
       "      <td>18.0</td>\n",
       "      <td>25.0</td>\n",
       "      <td>NaN</td>\n",
       "      <td>NaN</td>\n",
       "      <td>0.5</td>\n",
       "      <td>NaN</td>\n",
       "      <td>1.05</td>\n",
       "      <td>1.03</td>\n",
       "      <td>1.03</td>\n",
       "      <td>1.03</td>\n",
       "      <td>0.97</td>\n",
       "      <td>0.85</td>\n",
       "      <td>1.03</td>\n",
       "      <td>37.62</td>\n",
       "      <td>36.31</td>\n",
       "      <td>39.33</td>\n",
       "      <td>94</td>\n",
       "      <td>23</td>\n",
       "      <td>0</td>\n",
       "      <td>0.587366</td>\n",
       "      <td>0.587366</td>\n",
       "      <td>0.614903</td>\n",
       "      <td>0.791676</td>\n",
       "      <td>0.05456</td>\n",
       "      <td>0.05456</td>\n",
       "      <td>0.05456</td>\n",
       "      <td>0.054560</td>\n",
       "      <td>48</td>\n",
       "      <td>28</td>\n",
       "      <td>0</td>\n",
       "      <td>12</td>\n",
       "      <td>0</td>\n",
       "      <td>0</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>82</th>\n",
       "      <td>NaN</td>\n",
       "      <td>nan</td>\n",
       "      <td>Afghanistan</td>\n",
       "      <td>33.0</td>\n",
       "      <td>65.0</td>\n",
       "      <td>2020-04-13</td>\n",
       "      <td>30.343999</td>\n",
       "      <td>1.753275</td>\n",
       "      <td>33.0</td>\n",
       "      <td>Afghanistan</td>\n",
       "      <td>104</td>\n",
       "      <td>0.562330</td>\n",
       "      <td>0.05456</td>\n",
       "      <td>20.475517</td>\n",
       "      <td>Afghanistan</td>\n",
       "      <td>528.154</td>\n",
       "      <td>1692.57</td>\n",
       "      <td>320.469</td>\n",
       "      <td>14300.19</td>\n",
       "      <td>45827.64</td>\n",
       "      <td>NaN</td>\n",
       "      <td>75.87</td>\n",
       "      <td>2054.23</td>\n",
       "      <td>0.053</td>\n",
       "      <td>22.309</td>\n",
       "      <td>18.346</td>\n",
       "      <td>20.174</td>\n",
       "      <td>124.809</td>\n",
       "      <td>131.29</td>\n",
       "      <td>NaN</td>\n",
       "      <td>3.559</td>\n",
       "      <td>2.773</td>\n",
       "      <td>13.252</td>\n",
       "      <td>17.026</td>\n",
       "      <td>NaN</td>\n",
       "      <td>NaN</td>\n",
       "      <td>36.933</td>\n",
       "      <td>469.79</td>\n",
       "      <td>467.62</td>\n",
       "      <td>2.17</td>\n",
       "      <td>NaN</td>\n",
       "      <td>2.532</td>\n",
       "      <td>NaN</td>\n",
       "      <td>101.669</td>\n",
       "      <td>1692.57</td>\n",
       "      <td>0.425</td>\n",
       "      <td>64.5</td>\n",
       "      <td>38928346.0</td>\n",
       "      <td>60.0</td>\n",
       "      <td>18.0</td>\n",
       "      <td>25.0</td>\n",
       "      <td>NaN</td>\n",
       "      <td>NaN</td>\n",
       "      <td>0.5</td>\n",
       "      <td>NaN</td>\n",
       "      <td>1.05</td>\n",
       "      <td>1.03</td>\n",
       "      <td>1.03</td>\n",
       "      <td>1.03</td>\n",
       "      <td>0.97</td>\n",
       "      <td>0.85</td>\n",
       "      <td>1.03</td>\n",
       "      <td>37.62</td>\n",
       "      <td>36.31</td>\n",
       "      <td>39.33</td>\n",
       "      <td>95</td>\n",
       "      <td>23</td>\n",
       "      <td>0</td>\n",
       "      <td>0.587366</td>\n",
       "      <td>0.587366</td>\n",
       "      <td>0.587366</td>\n",
       "      <td>0.780128</td>\n",
       "      <td>0.05456</td>\n",
       "      <td>0.05456</td>\n",
       "      <td>0.05456</td>\n",
       "      <td>0.054560</td>\n",
       "      <td>49</td>\n",
       "      <td>29</td>\n",
       "      <td>0</td>\n",
       "      <td>13</td>\n",
       "      <td>0</td>\n",
       "      <td>0</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>83</th>\n",
       "      <td>NaN</td>\n",
       "      <td>nan</td>\n",
       "      <td>Afghanistan</td>\n",
       "      <td>33.0</td>\n",
       "      <td>65.0</td>\n",
       "      <td>2020-04-14</td>\n",
       "      <td>30.906328</td>\n",
       "      <td>1.807834</td>\n",
       "      <td>34.0</td>\n",
       "      <td>Afghanistan</td>\n",
       "      <td>105</td>\n",
       "      <td>0.562330</td>\n",
       "      <td>0.05456</td>\n",
       "      <td>20.475517</td>\n",
       "      <td>Afghanistan</td>\n",
       "      <td>528.154</td>\n",
       "      <td>1692.57</td>\n",
       "      <td>320.469</td>\n",
       "      <td>14300.19</td>\n",
       "      <td>45827.64</td>\n",
       "      <td>NaN</td>\n",
       "      <td>75.87</td>\n",
       "      <td>2054.23</td>\n",
       "      <td>0.053</td>\n",
       "      <td>22.309</td>\n",
       "      <td>18.346</td>\n",
       "      <td>20.174</td>\n",
       "      <td>124.809</td>\n",
       "      <td>131.29</td>\n",
       "      <td>NaN</td>\n",
       "      <td>3.559</td>\n",
       "      <td>2.773</td>\n",
       "      <td>13.252</td>\n",
       "      <td>17.026</td>\n",
       "      <td>NaN</td>\n",
       "      <td>NaN</td>\n",
       "      <td>36.933</td>\n",
       "      <td>469.79</td>\n",
       "      <td>467.62</td>\n",
       "      <td>2.17</td>\n",
       "      <td>NaN</td>\n",
       "      <td>2.532</td>\n",
       "      <td>NaN</td>\n",
       "      <td>101.669</td>\n",
       "      <td>1692.57</td>\n",
       "      <td>0.425</td>\n",
       "      <td>64.5</td>\n",
       "      <td>38928346.0</td>\n",
       "      <td>60.0</td>\n",
       "      <td>18.0</td>\n",
       "      <td>25.0</td>\n",
       "      <td>NaN</td>\n",
       "      <td>NaN</td>\n",
       "      <td>0.5</td>\n",
       "      <td>NaN</td>\n",
       "      <td>1.05</td>\n",
       "      <td>1.03</td>\n",
       "      <td>1.03</td>\n",
       "      <td>1.03</td>\n",
       "      <td>0.97</td>\n",
       "      <td>0.85</td>\n",
       "      <td>1.03</td>\n",
       "      <td>37.62</td>\n",
       "      <td>36.31</td>\n",
       "      <td>39.33</td>\n",
       "      <td>96</td>\n",
       "      <td>23</td>\n",
       "      <td>0</td>\n",
       "      <td>0.562330</td>\n",
       "      <td>0.583789</td>\n",
       "      <td>0.587366</td>\n",
       "      <td>0.752590</td>\n",
       "      <td>0.05456</td>\n",
       "      <td>0.05456</td>\n",
       "      <td>0.05456</td>\n",
       "      <td>0.054560</td>\n",
       "      <td>50</td>\n",
       "      <td>30</td>\n",
       "      <td>0</td>\n",
       "      <td>14</td>\n",
       "      <td>0</td>\n",
       "      <td>0</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>84</th>\n",
       "      <td>NaN</td>\n",
       "      <td>nan</td>\n",
       "      <td>Afghanistan</td>\n",
       "      <td>33.0</td>\n",
       "      <td>65.0</td>\n",
       "      <td>2020-04-15</td>\n",
       "      <td>31.468658</td>\n",
       "      <td>1.862394</td>\n",
       "      <td>35.0</td>\n",
       "      <td>Afghanistan</td>\n",
       "      <td>106</td>\n",
       "      <td>0.562330</td>\n",
       "      <td>0.05456</td>\n",
       "      <td>20.475517</td>\n",
       "      <td>Afghanistan</td>\n",
       "      <td>528.154</td>\n",
       "      <td>1692.57</td>\n",
       "      <td>320.469</td>\n",
       "      <td>14300.19</td>\n",
       "      <td>45827.64</td>\n",
       "      <td>NaN</td>\n",
       "      <td>75.87</td>\n",
       "      <td>2054.23</td>\n",
       "      <td>0.053</td>\n",
       "      <td>22.309</td>\n",
       "      <td>18.346</td>\n",
       "      <td>20.174</td>\n",
       "      <td>124.809</td>\n",
       "      <td>131.29</td>\n",
       "      <td>NaN</td>\n",
       "      <td>3.559</td>\n",
       "      <td>2.773</td>\n",
       "      <td>13.252</td>\n",
       "      <td>17.026</td>\n",
       "      <td>NaN</td>\n",
       "      <td>NaN</td>\n",
       "      <td>36.933</td>\n",
       "      <td>469.79</td>\n",
       "      <td>467.62</td>\n",
       "      <td>2.17</td>\n",
       "      <td>NaN</td>\n",
       "      <td>2.532</td>\n",
       "      <td>NaN</td>\n",
       "      <td>101.669</td>\n",
       "      <td>1692.57</td>\n",
       "      <td>0.425</td>\n",
       "      <td>64.5</td>\n",
       "      <td>38928346.0</td>\n",
       "      <td>60.0</td>\n",
       "      <td>18.0</td>\n",
       "      <td>25.0</td>\n",
       "      <td>NaN</td>\n",
       "      <td>NaN</td>\n",
       "      <td>0.5</td>\n",
       "      <td>NaN</td>\n",
       "      <td>1.05</td>\n",
       "      <td>1.03</td>\n",
       "      <td>1.03</td>\n",
       "      <td>1.03</td>\n",
       "      <td>0.97</td>\n",
       "      <td>0.85</td>\n",
       "      <td>1.03</td>\n",
       "      <td>37.62</td>\n",
       "      <td>36.31</td>\n",
       "      <td>39.33</td>\n",
       "      <td>97</td>\n",
       "      <td>23</td>\n",
       "      <td>0</td>\n",
       "      <td>0.562330</td>\n",
       "      <td>0.580213</td>\n",
       "      <td>0.587366</td>\n",
       "      <td>0.725053</td>\n",
       "      <td>0.05456</td>\n",
       "      <td>0.05456</td>\n",
       "      <td>0.05456</td>\n",
       "      <td>0.054560</td>\n",
       "      <td>51</td>\n",
       "      <td>31</td>\n",
       "      <td>0</td>\n",
       "      <td>15</td>\n",
       "      <td>0</td>\n",
       "      <td>0</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>85</th>\n",
       "      <td>NaN</td>\n",
       "      <td>nan</td>\n",
       "      <td>Afghanistan</td>\n",
       "      <td>33.0</td>\n",
       "      <td>65.0</td>\n",
       "      <td>2020-04-16</td>\n",
       "      <td>32.030988</td>\n",
       "      <td>1.916954</td>\n",
       "      <td>36.0</td>\n",
       "      <td>Afghanistan</td>\n",
       "      <td>107</td>\n",
       "      <td>0.562330</td>\n",
       "      <td>0.05456</td>\n",
       "      <td>20.475517</td>\n",
       "      <td>Afghanistan</td>\n",
       "      <td>528.154</td>\n",
       "      <td>1692.57</td>\n",
       "      <td>320.469</td>\n",
       "      <td>14300.19</td>\n",
       "      <td>45827.64</td>\n",
       "      <td>NaN</td>\n",
       "      <td>75.87</td>\n",
       "      <td>2054.23</td>\n",
       "      <td>0.053</td>\n",
       "      <td>22.309</td>\n",
       "      <td>18.346</td>\n",
       "      <td>20.174</td>\n",
       "      <td>124.809</td>\n",
       "      <td>131.29</td>\n",
       "      <td>NaN</td>\n",
       "      <td>3.559</td>\n",
       "      <td>2.773</td>\n",
       "      <td>13.252</td>\n",
       "      <td>17.026</td>\n",
       "      <td>NaN</td>\n",
       "      <td>NaN</td>\n",
       "      <td>36.933</td>\n",
       "      <td>469.79</td>\n",
       "      <td>467.62</td>\n",
       "      <td>2.17</td>\n",
       "      <td>NaN</td>\n",
       "      <td>2.532</td>\n",
       "      <td>NaN</td>\n",
       "      <td>101.669</td>\n",
       "      <td>1692.57</td>\n",
       "      <td>0.425</td>\n",
       "      <td>64.5</td>\n",
       "      <td>38928346.0</td>\n",
       "      <td>60.0</td>\n",
       "      <td>18.0</td>\n",
       "      <td>25.0</td>\n",
       "      <td>NaN</td>\n",
       "      <td>NaN</td>\n",
       "      <td>0.5</td>\n",
       "      <td>NaN</td>\n",
       "      <td>1.05</td>\n",
       "      <td>1.03</td>\n",
       "      <td>1.03</td>\n",
       "      <td>1.03</td>\n",
       "      <td>0.97</td>\n",
       "      <td>0.85</td>\n",
       "      <td>1.03</td>\n",
       "      <td>37.62</td>\n",
       "      <td>36.31</td>\n",
       "      <td>39.33</td>\n",
       "      <td>98</td>\n",
       "      <td>23</td>\n",
       "      <td>0</td>\n",
       "      <td>0.562330</td>\n",
       "      <td>0.576636</td>\n",
       "      <td>0.587366</td>\n",
       "      <td>0.697516</td>\n",
       "      <td>0.05456</td>\n",
       "      <td>0.05456</td>\n",
       "      <td>0.05456</td>\n",
       "      <td>0.054560</td>\n",
       "      <td>52</td>\n",
       "      <td>32</td>\n",
       "      <td>0</td>\n",
       "      <td>16</td>\n",
       "      <td>0</td>\n",
       "      <td>0</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>86</th>\n",
       "      <td>NaN</td>\n",
       "      <td>nan</td>\n",
       "      <td>Afghanistan</td>\n",
       "      <td>33.0</td>\n",
       "      <td>65.0</td>\n",
       "      <td>2020-04-17</td>\n",
       "      <td>32.593317</td>\n",
       "      <td>1.971513</td>\n",
       "      <td>37.0</td>\n",
       "      <td>Afghanistan</td>\n",
       "      <td>108</td>\n",
       "      <td>0.562330</td>\n",
       "      <td>0.05456</td>\n",
       "      <td>20.475517</td>\n",
       "      <td>Afghanistan</td>\n",
       "      <td>528.154</td>\n",
       "      <td>1692.57</td>\n",
       "      <td>320.469</td>\n",
       "      <td>14300.19</td>\n",
       "      <td>45827.64</td>\n",
       "      <td>NaN</td>\n",
       "      <td>75.87</td>\n",
       "      <td>2054.23</td>\n",
       "      <td>0.053</td>\n",
       "      <td>22.309</td>\n",
       "      <td>18.346</td>\n",
       "      <td>20.174</td>\n",
       "      <td>124.809</td>\n",
       "      <td>131.29</td>\n",
       "      <td>NaN</td>\n",
       "      <td>3.559</td>\n",
       "      <td>2.773</td>\n",
       "      <td>13.252</td>\n",
       "      <td>17.026</td>\n",
       "      <td>NaN</td>\n",
       "      <td>NaN</td>\n",
       "      <td>36.933</td>\n",
       "      <td>469.79</td>\n",
       "      <td>467.62</td>\n",
       "      <td>2.17</td>\n",
       "      <td>NaN</td>\n",
       "      <td>2.532</td>\n",
       "      <td>NaN</td>\n",
       "      <td>101.669</td>\n",
       "      <td>1692.57</td>\n",
       "      <td>0.425</td>\n",
       "      <td>64.5</td>\n",
       "      <td>38928346.0</td>\n",
       "      <td>60.0</td>\n",
       "      <td>18.0</td>\n",
       "      <td>25.0</td>\n",
       "      <td>NaN</td>\n",
       "      <td>NaN</td>\n",
       "      <td>0.5</td>\n",
       "      <td>NaN</td>\n",
       "      <td>1.05</td>\n",
       "      <td>1.03</td>\n",
       "      <td>1.03</td>\n",
       "      <td>1.03</td>\n",
       "      <td>0.97</td>\n",
       "      <td>0.85</td>\n",
       "      <td>1.03</td>\n",
       "      <td>37.62</td>\n",
       "      <td>36.31</td>\n",
       "      <td>39.33</td>\n",
       "      <td>99</td>\n",
       "      <td>23</td>\n",
       "      <td>0</td>\n",
       "      <td>0.562330</td>\n",
       "      <td>0.573059</td>\n",
       "      <td>0.587366</td>\n",
       "      <td>0.669978</td>\n",
       "      <td>0.05456</td>\n",
       "      <td>0.05456</td>\n",
       "      <td>0.05456</td>\n",
       "      <td>0.054560</td>\n",
       "      <td>53</td>\n",
       "      <td>33</td>\n",
       "      <td>0</td>\n",
       "      <td>17</td>\n",
       "      <td>0</td>\n",
       "      <td>0</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>87</th>\n",
       "      <td>NaN</td>\n",
       "      <td>nan</td>\n",
       "      <td>Afghanistan</td>\n",
       "      <td>33.0</td>\n",
       "      <td>65.0</td>\n",
       "      <td>2020-04-18</td>\n",
       "      <td>33.155647</td>\n",
       "      <td>2.026073</td>\n",
       "      <td>38.0</td>\n",
       "      <td>Afghanistan</td>\n",
       "      <td>109</td>\n",
       "      <td>0.562330</td>\n",
       "      <td>0.05456</td>\n",
       "      <td>20.475517</td>\n",
       "      <td>Afghanistan</td>\n",
       "      <td>528.154</td>\n",
       "      <td>1692.57</td>\n",
       "      <td>320.469</td>\n",
       "      <td>14300.19</td>\n",
       "      <td>45827.64</td>\n",
       "      <td>NaN</td>\n",
       "      <td>75.87</td>\n",
       "      <td>2054.23</td>\n",
       "      <td>0.053</td>\n",
       "      <td>22.309</td>\n",
       "      <td>18.346</td>\n",
       "      <td>20.174</td>\n",
       "      <td>124.809</td>\n",
       "      <td>131.29</td>\n",
       "      <td>NaN</td>\n",
       "      <td>3.559</td>\n",
       "      <td>2.773</td>\n",
       "      <td>13.252</td>\n",
       "      <td>17.026</td>\n",
       "      <td>NaN</td>\n",
       "      <td>NaN</td>\n",
       "      <td>36.933</td>\n",
       "      <td>469.79</td>\n",
       "      <td>467.62</td>\n",
       "      <td>2.17</td>\n",
       "      <td>NaN</td>\n",
       "      <td>2.532</td>\n",
       "      <td>NaN</td>\n",
       "      <td>101.669</td>\n",
       "      <td>1692.57</td>\n",
       "      <td>0.425</td>\n",
       "      <td>64.5</td>\n",
       "      <td>38928346.0</td>\n",
       "      <td>60.0</td>\n",
       "      <td>18.0</td>\n",
       "      <td>25.0</td>\n",
       "      <td>NaN</td>\n",
       "      <td>NaN</td>\n",
       "      <td>0.5</td>\n",
       "      <td>NaN</td>\n",
       "      <td>1.05</td>\n",
       "      <td>1.03</td>\n",
       "      <td>1.03</td>\n",
       "      <td>1.03</td>\n",
       "      <td>0.97</td>\n",
       "      <td>0.85</td>\n",
       "      <td>1.03</td>\n",
       "      <td>37.62</td>\n",
       "      <td>36.31</td>\n",
       "      <td>39.33</td>\n",
       "      <td>100</td>\n",
       "      <td>23</td>\n",
       "      <td>0</td>\n",
       "      <td>0.562330</td>\n",
       "      <td>0.569483</td>\n",
       "      <td>0.587366</td>\n",
       "      <td>0.642441</td>\n",
       "      <td>0.05456</td>\n",
       "      <td>0.05456</td>\n",
       "      <td>0.05456</td>\n",
       "      <td>0.054560</td>\n",
       "      <td>54</td>\n",
       "      <td>34</td>\n",
       "      <td>0</td>\n",
       "      <td>18</td>\n",
       "      <td>0</td>\n",
       "      <td>0</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>88</th>\n",
       "      <td>NaN</td>\n",
       "      <td>nan</td>\n",
       "      <td>Afghanistan</td>\n",
       "      <td>33.0</td>\n",
       "      <td>65.0</td>\n",
       "      <td>2020-04-19</td>\n",
       "      <td>33.717977</td>\n",
       "      <td>2.080632</td>\n",
       "      <td>39.0</td>\n",
       "      <td>Afghanistan</td>\n",
       "      <td>110</td>\n",
       "      <td>0.562330</td>\n",
       "      <td>0.05456</td>\n",
       "      <td>20.475517</td>\n",
       "      <td>Afghanistan</td>\n",
       "      <td>528.154</td>\n",
       "      <td>1692.57</td>\n",
       "      <td>320.469</td>\n",
       "      <td>14300.19</td>\n",
       "      <td>45827.64</td>\n",
       "      <td>NaN</td>\n",
       "      <td>75.87</td>\n",
       "      <td>2054.23</td>\n",
       "      <td>0.053</td>\n",
       "      <td>22.309</td>\n",
       "      <td>18.346</td>\n",
       "      <td>20.174</td>\n",
       "      <td>124.809</td>\n",
       "      <td>131.29</td>\n",
       "      <td>NaN</td>\n",
       "      <td>3.559</td>\n",
       "      <td>2.773</td>\n",
       "      <td>13.252</td>\n",
       "      <td>17.026</td>\n",
       "      <td>NaN</td>\n",
       "      <td>NaN</td>\n",
       "      <td>36.933</td>\n",
       "      <td>469.79</td>\n",
       "      <td>467.62</td>\n",
       "      <td>2.17</td>\n",
       "      <td>NaN</td>\n",
       "      <td>2.532</td>\n",
       "      <td>NaN</td>\n",
       "      <td>101.669</td>\n",
       "      <td>1692.57</td>\n",
       "      <td>0.425</td>\n",
       "      <td>64.5</td>\n",
       "      <td>38928346.0</td>\n",
       "      <td>60.0</td>\n",
       "      <td>18.0</td>\n",
       "      <td>25.0</td>\n",
       "      <td>NaN</td>\n",
       "      <td>NaN</td>\n",
       "      <td>0.5</td>\n",
       "      <td>NaN</td>\n",
       "      <td>1.05</td>\n",
       "      <td>1.03</td>\n",
       "      <td>1.03</td>\n",
       "      <td>1.03</td>\n",
       "      <td>0.97</td>\n",
       "      <td>0.85</td>\n",
       "      <td>1.03</td>\n",
       "      <td>37.62</td>\n",
       "      <td>36.31</td>\n",
       "      <td>39.33</td>\n",
       "      <td>101</td>\n",
       "      <td>23</td>\n",
       "      <td>0</td>\n",
       "      <td>0.562330</td>\n",
       "      <td>0.565906</td>\n",
       "      <td>0.587366</td>\n",
       "      <td>0.614903</td>\n",
       "      <td>0.05456</td>\n",
       "      <td>0.05456</td>\n",
       "      <td>0.05456</td>\n",
       "      <td>0.054560</td>\n",
       "      <td>55</td>\n",
       "      <td>35</td>\n",
       "      <td>0</td>\n",
       "      <td>19</td>\n",
       "      <td>0</td>\n",
       "      <td>0</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>89</th>\n",
       "      <td>NaN</td>\n",
       "      <td>nan</td>\n",
       "      <td>Afghanistan</td>\n",
       "      <td>33.0</td>\n",
       "      <td>65.0</td>\n",
       "      <td>2020-04-20</td>\n",
       "      <td>34.280306</td>\n",
       "      <td>2.135192</td>\n",
       "      <td>40.0</td>\n",
       "      <td>Afghanistan</td>\n",
       "      <td>111</td>\n",
       "      <td>0.562330</td>\n",
       "      <td>0.05456</td>\n",
       "      <td>20.475517</td>\n",
       "      <td>Afghanistan</td>\n",
       "      <td>528.154</td>\n",
       "      <td>1692.57</td>\n",
       "      <td>320.469</td>\n",
       "      <td>14300.19</td>\n",
       "      <td>45827.64</td>\n",
       "      <td>NaN</td>\n",
       "      <td>75.87</td>\n",
       "      <td>2054.23</td>\n",
       "      <td>0.053</td>\n",
       "      <td>22.309</td>\n",
       "      <td>18.346</td>\n",
       "      <td>20.174</td>\n",
       "      <td>124.809</td>\n",
       "      <td>131.29</td>\n",
       "      <td>NaN</td>\n",
       "      <td>3.559</td>\n",
       "      <td>2.773</td>\n",
       "      <td>13.252</td>\n",
       "      <td>17.026</td>\n",
       "      <td>NaN</td>\n",
       "      <td>NaN</td>\n",
       "      <td>36.933</td>\n",
       "      <td>469.79</td>\n",
       "      <td>467.62</td>\n",
       "      <td>2.17</td>\n",
       "      <td>NaN</td>\n",
       "      <td>2.532</td>\n",
       "      <td>NaN</td>\n",
       "      <td>101.669</td>\n",
       "      <td>1692.57</td>\n",
       "      <td>0.425</td>\n",
       "      <td>64.5</td>\n",
       "      <td>38928346.0</td>\n",
       "      <td>60.0</td>\n",
       "      <td>18.0</td>\n",
       "      <td>25.0</td>\n",
       "      <td>NaN</td>\n",
       "      <td>NaN</td>\n",
       "      <td>0.5</td>\n",
       "      <td>NaN</td>\n",
       "      <td>1.05</td>\n",
       "      <td>1.03</td>\n",
       "      <td>1.03</td>\n",
       "      <td>1.03</td>\n",
       "      <td>0.97</td>\n",
       "      <td>0.85</td>\n",
       "      <td>1.03</td>\n",
       "      <td>37.62</td>\n",
       "      <td>36.31</td>\n",
       "      <td>39.33</td>\n",
       "      <td>102</td>\n",
       "      <td>23</td>\n",
       "      <td>0</td>\n",
       "      <td>0.562330</td>\n",
       "      <td>0.562330</td>\n",
       "      <td>0.587366</td>\n",
       "      <td>0.587366</td>\n",
       "      <td>0.05456</td>\n",
       "      <td>0.05456</td>\n",
       "      <td>0.05456</td>\n",
       "      <td>0.054560</td>\n",
       "      <td>56</td>\n",
       "      <td>36</td>\n",
       "      <td>0</td>\n",
       "      <td>20</td>\n",
       "      <td>0</td>\n",
       "      <td>0</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>90</th>\n",
       "      <td>NaN</td>\n",
       "      <td>nan</td>\n",
       "      <td>Afghanistan</td>\n",
       "      <td>33.0</td>\n",
       "      <td>65.0</td>\n",
       "      <td>2020-04-21</td>\n",
       "      <td>34.842636</td>\n",
       "      <td>2.189752</td>\n",
       "      <td>41.0</td>\n",
       "      <td>Afghanistan</td>\n",
       "      <td>112</td>\n",
       "      <td>0.562330</td>\n",
       "      <td>0.05456</td>\n",
       "      <td>20.475517</td>\n",
       "      <td>Afghanistan</td>\n",
       "      <td>528.154</td>\n",
       "      <td>1692.57</td>\n",
       "      <td>320.469</td>\n",
       "      <td>14300.19</td>\n",
       "      <td>45827.64</td>\n",
       "      <td>NaN</td>\n",
       "      <td>75.87</td>\n",
       "      <td>2054.23</td>\n",
       "      <td>0.053</td>\n",
       "      <td>22.309</td>\n",
       "      <td>18.346</td>\n",
       "      <td>20.174</td>\n",
       "      <td>124.809</td>\n",
       "      <td>131.29</td>\n",
       "      <td>NaN</td>\n",
       "      <td>3.559</td>\n",
       "      <td>2.773</td>\n",
       "      <td>13.252</td>\n",
       "      <td>17.026</td>\n",
       "      <td>NaN</td>\n",
       "      <td>NaN</td>\n",
       "      <td>36.933</td>\n",
       "      <td>469.79</td>\n",
       "      <td>467.62</td>\n",
       "      <td>2.17</td>\n",
       "      <td>NaN</td>\n",
       "      <td>2.532</td>\n",
       "      <td>NaN</td>\n",
       "      <td>101.669</td>\n",
       "      <td>1692.57</td>\n",
       "      <td>0.425</td>\n",
       "      <td>64.5</td>\n",
       "      <td>38928346.0</td>\n",
       "      <td>60.0</td>\n",
       "      <td>18.0</td>\n",
       "      <td>25.0</td>\n",
       "      <td>NaN</td>\n",
       "      <td>NaN</td>\n",
       "      <td>0.5</td>\n",
       "      <td>NaN</td>\n",
       "      <td>1.05</td>\n",
       "      <td>1.03</td>\n",
       "      <td>1.03</td>\n",
       "      <td>1.03</td>\n",
       "      <td>0.97</td>\n",
       "      <td>0.85</td>\n",
       "      <td>1.03</td>\n",
       "      <td>37.62</td>\n",
       "      <td>36.31</td>\n",
       "      <td>39.33</td>\n",
       "      <td>103</td>\n",
       "      <td>23</td>\n",
       "      <td>0</td>\n",
       "      <td>0.562330</td>\n",
       "      <td>0.562330</td>\n",
       "      <td>0.583789</td>\n",
       "      <td>0.587366</td>\n",
       "      <td>0.05456</td>\n",
       "      <td>0.05456</td>\n",
       "      <td>0.05456</td>\n",
       "      <td>0.054560</td>\n",
       "      <td>57</td>\n",
       "      <td>37</td>\n",
       "      <td>0</td>\n",
       "      <td>21</td>\n",
       "      <td>0</td>\n",
       "      <td>0</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>91</th>\n",
       "      <td>NaN</td>\n",
       "      <td>nan</td>\n",
       "      <td>Afghanistan</td>\n",
       "      <td>33.0</td>\n",
       "      <td>65.0</td>\n",
       "      <td>2020-04-22</td>\n",
       "      <td>35.404966</td>\n",
       "      <td>2.244311</td>\n",
       "      <td>42.0</td>\n",
       "      <td>Afghanistan</td>\n",
       "      <td>113</td>\n",
       "      <td>0.562330</td>\n",
       "      <td>0.05456</td>\n",
       "      <td>20.475517</td>\n",
       "      <td>Afghanistan</td>\n",
       "      <td>528.154</td>\n",
       "      <td>1692.57</td>\n",
       "      <td>320.469</td>\n",
       "      <td>14300.19</td>\n",
       "      <td>45827.64</td>\n",
       "      <td>NaN</td>\n",
       "      <td>75.87</td>\n",
       "      <td>2054.23</td>\n",
       "      <td>0.053</td>\n",
       "      <td>22.309</td>\n",
       "      <td>18.346</td>\n",
       "      <td>20.174</td>\n",
       "      <td>124.809</td>\n",
       "      <td>131.29</td>\n",
       "      <td>NaN</td>\n",
       "      <td>3.559</td>\n",
       "      <td>2.773</td>\n",
       "      <td>13.252</td>\n",
       "      <td>17.026</td>\n",
       "      <td>NaN</td>\n",
       "      <td>NaN</td>\n",
       "      <td>36.933</td>\n",
       "      <td>469.79</td>\n",
       "      <td>467.62</td>\n",
       "      <td>2.17</td>\n",
       "      <td>NaN</td>\n",
       "      <td>2.532</td>\n",
       "      <td>NaN</td>\n",
       "      <td>101.669</td>\n",
       "      <td>1692.57</td>\n",
       "      <td>0.425</td>\n",
       "      <td>64.5</td>\n",
       "      <td>38928346.0</td>\n",
       "      <td>60.0</td>\n",
       "      <td>18.0</td>\n",
       "      <td>25.0</td>\n",
       "      <td>NaN</td>\n",
       "      <td>NaN</td>\n",
       "      <td>0.5</td>\n",
       "      <td>NaN</td>\n",
       "      <td>1.05</td>\n",
       "      <td>1.03</td>\n",
       "      <td>1.03</td>\n",
       "      <td>1.03</td>\n",
       "      <td>0.97</td>\n",
       "      <td>0.85</td>\n",
       "      <td>1.03</td>\n",
       "      <td>37.62</td>\n",
       "      <td>36.31</td>\n",
       "      <td>39.33</td>\n",
       "      <td>104</td>\n",
       "      <td>23</td>\n",
       "      <td>0</td>\n",
       "      <td>0.562330</td>\n",
       "      <td>0.562330</td>\n",
       "      <td>0.580213</td>\n",
       "      <td>0.587366</td>\n",
       "      <td>0.05456</td>\n",
       "      <td>0.05456</td>\n",
       "      <td>0.05456</td>\n",
       "      <td>0.054560</td>\n",
       "      <td>58</td>\n",
       "      <td>38</td>\n",
       "      <td>0</td>\n",
       "      <td>22</td>\n",
       "      <td>0</td>\n",
       "      <td>0</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>92</th>\n",
       "      <td>NaN</td>\n",
       "      <td>nan</td>\n",
       "      <td>Afghanistan</td>\n",
       "      <td>33.0</td>\n",
       "      <td>65.0</td>\n",
       "      <td>2020-04-23</td>\n",
       "      <td>35.967295</td>\n",
       "      <td>2.298871</td>\n",
       "      <td>43.0</td>\n",
       "      <td>Afghanistan</td>\n",
       "      <td>114</td>\n",
       "      <td>0.562330</td>\n",
       "      <td>0.05456</td>\n",
       "      <td>20.475517</td>\n",
       "      <td>Afghanistan</td>\n",
       "      <td>528.154</td>\n",
       "      <td>1692.57</td>\n",
       "      <td>320.469</td>\n",
       "      <td>14300.19</td>\n",
       "      <td>45827.64</td>\n",
       "      <td>NaN</td>\n",
       "      <td>75.87</td>\n",
       "      <td>2054.23</td>\n",
       "      <td>0.053</td>\n",
       "      <td>22.309</td>\n",
       "      <td>18.346</td>\n",
       "      <td>20.174</td>\n",
       "      <td>124.809</td>\n",
       "      <td>131.29</td>\n",
       "      <td>NaN</td>\n",
       "      <td>3.559</td>\n",
       "      <td>2.773</td>\n",
       "      <td>13.252</td>\n",
       "      <td>17.026</td>\n",
       "      <td>NaN</td>\n",
       "      <td>NaN</td>\n",
       "      <td>36.933</td>\n",
       "      <td>469.79</td>\n",
       "      <td>467.62</td>\n",
       "      <td>2.17</td>\n",
       "      <td>NaN</td>\n",
       "      <td>2.532</td>\n",
       "      <td>NaN</td>\n",
       "      <td>101.669</td>\n",
       "      <td>1692.57</td>\n",
       "      <td>0.425</td>\n",
       "      <td>64.5</td>\n",
       "      <td>38928346.0</td>\n",
       "      <td>60.0</td>\n",
       "      <td>18.0</td>\n",
       "      <td>25.0</td>\n",
       "      <td>NaN</td>\n",
       "      <td>NaN</td>\n",
       "      <td>0.5</td>\n",
       "      <td>NaN</td>\n",
       "      <td>1.05</td>\n",
       "      <td>1.03</td>\n",
       "      <td>1.03</td>\n",
       "      <td>1.03</td>\n",
       "      <td>0.97</td>\n",
       "      <td>0.85</td>\n",
       "      <td>1.03</td>\n",
       "      <td>37.62</td>\n",
       "      <td>36.31</td>\n",
       "      <td>39.33</td>\n",
       "      <td>105</td>\n",
       "      <td>23</td>\n",
       "      <td>0</td>\n",
       "      <td>0.562330</td>\n",
       "      <td>0.562330</td>\n",
       "      <td>0.576636</td>\n",
       "      <td>0.587366</td>\n",
       "      <td>0.05456</td>\n",
       "      <td>0.05456</td>\n",
       "      <td>0.05456</td>\n",
       "      <td>0.054560</td>\n",
       "      <td>59</td>\n",
       "      <td>39</td>\n",
       "      <td>0</td>\n",
       "      <td>23</td>\n",
       "      <td>0</td>\n",
       "      <td>0</td>\n",
       "    </tr>\n",
       "  </tbody>\n",
       "</table>\n",
       "</div>"
      ],
      "text/plain": [
       "    Id Province/State Country/Region   Lat  Long       Date  ConfirmedCases  \\\n",
       "69 NaN            nan    Afghanistan  33.0  65.0 2020-03-31       22.733279   \n",
       "70 NaN            nan    Afghanistan  33.0  65.0 2020-04-01       23.320644   \n",
       "71 NaN            nan    Afghanistan  33.0  65.0 2020-04-02       23.908010   \n",
       "72 NaN            nan    Afghanistan  33.0  65.0 2020-04-03       24.495376   \n",
       "73 NaN            nan    Afghanistan  33.0  65.0 2020-04-04       25.082742   \n",
       "74 NaN            nan    Afghanistan  33.0  65.0 2020-04-05       25.670108   \n",
       "75 NaN            nan    Afghanistan  33.0  65.0 2020-04-06       26.257474   \n",
       "76 NaN            nan    Afghanistan  33.0  65.0 2020-04-07       26.844840   \n",
       "77 NaN            nan    Afghanistan  33.0  65.0 2020-04-08       27.432206   \n",
       "78 NaN            nan    Afghanistan  33.0  65.0 2020-04-09       28.019571   \n",
       "79 NaN            nan    Afghanistan  33.0  65.0 2020-04-10       28.606937   \n",
       "80 NaN            nan    Afghanistan  33.0  65.0 2020-04-11       29.194303   \n",
       "81 NaN            nan    Afghanistan  33.0  65.0 2020-04-12       29.781669   \n",
       "82 NaN            nan    Afghanistan  33.0  65.0 2020-04-13       30.343999   \n",
       "83 NaN            nan    Afghanistan  33.0  65.0 2020-04-14       30.906328   \n",
       "84 NaN            nan    Afghanistan  33.0  65.0 2020-04-15       31.468658   \n",
       "85 NaN            nan    Afghanistan  33.0  65.0 2020-04-16       32.030988   \n",
       "86 NaN            nan    Afghanistan  33.0  65.0 2020-04-17       32.593317   \n",
       "87 NaN            nan    Afghanistan  33.0  65.0 2020-04-18       33.155647   \n",
       "88 NaN            nan    Afghanistan  33.0  65.0 2020-04-19       33.717977   \n",
       "89 NaN            nan    Afghanistan  33.0  65.0 2020-04-20       34.280306   \n",
       "90 NaN            nan    Afghanistan  33.0  65.0 2020-04-21       34.842636   \n",
       "91 NaN            nan    Afghanistan  33.0  65.0 2020-04-22       35.404966   \n",
       "92 NaN            nan    Afghanistan  33.0  65.0 2020-04-23       35.967295   \n",
       "\n",
       "    Fatalities  ForecastId     place_id  day  cases/day  fatal/day  \\\n",
       "69    1.044000        20.0  Afghanistan   91   0.587366    0.05456   \n",
       "70    1.098560        21.0  Afghanistan   92   0.587366    0.05456   \n",
       "71    1.153119        22.0  Afghanistan   93   0.587366    0.05456   \n",
       "72    1.207679        23.0  Afghanistan   94   0.587366    0.05456   \n",
       "73    1.262238        24.0  Afghanistan   95   0.587366    0.05456   \n",
       "74    1.316798        25.0  Afghanistan   96   0.587366    0.05456   \n",
       "75    1.371358        26.0  Afghanistan   97   0.587366    0.05456   \n",
       "76    1.425917        27.0  Afghanistan   98   0.587366    0.05456   \n",
       "77    1.480477        28.0  Afghanistan   99   0.587366    0.05456   \n",
       "78    1.535036        29.0  Afghanistan  100   0.587366    0.05456   \n",
       "79    1.589596        30.0  Afghanistan  101   0.587366    0.05456   \n",
       "80    1.644156        31.0  Afghanistan  102   0.587366    0.05456   \n",
       "81    1.698715        32.0  Afghanistan  103   0.587366    0.05456   \n",
       "82    1.753275        33.0  Afghanistan  104   0.562330    0.05456   \n",
       "83    1.807834        34.0  Afghanistan  105   0.562330    0.05456   \n",
       "84    1.862394        35.0  Afghanistan  106   0.562330    0.05456   \n",
       "85    1.916954        36.0  Afghanistan  107   0.562330    0.05456   \n",
       "86    1.971513        37.0  Afghanistan  108   0.562330    0.05456   \n",
       "87    2.026073        38.0  Afghanistan  109   0.562330    0.05456   \n",
       "88    2.080632        39.0  Afghanistan  110   0.562330    0.05456   \n",
       "89    2.135192        40.0  Afghanistan  111   0.562330    0.05456   \n",
       "90    2.189752        41.0  Afghanistan  112   0.562330    0.05456   \n",
       "91    2.244311        42.0  Afghanistan  113   0.562330    0.05456   \n",
       "92    2.298871        43.0  Afghanistan  114   0.562330    0.05456   \n",
       "\n",
       "    SmokingRate      Country  Gross_domestic_product__constant_prices  \\\n",
       "69    20.475517  Afghanistan                                  528.154   \n",
       "70    20.475517  Afghanistan                                  528.154   \n",
       "71    20.475517  Afghanistan                                  528.154   \n",
       "72    20.475517  Afghanistan                                  528.154   \n",
       "73    20.475517  Afghanistan                                  528.154   \n",
       "74    20.475517  Afghanistan                                  528.154   \n",
       "75    20.475517  Afghanistan                                  528.154   \n",
       "76    20.475517  Afghanistan                                  528.154   \n",
       "77    20.475517  Afghanistan                                  528.154   \n",
       "78    20.475517  Afghanistan                                  528.154   \n",
       "79    20.475517  Afghanistan                                  528.154   \n",
       "80    20.475517  Afghanistan                                  528.154   \n",
       "81    20.475517  Afghanistan                                  528.154   \n",
       "82    20.475517  Afghanistan                                  528.154   \n",
       "83    20.475517  Afghanistan                                  528.154   \n",
       "84    20.475517  Afghanistan                                  528.154   \n",
       "85    20.475517  Afghanistan                                  528.154   \n",
       "86    20.475517  Afghanistan                                  528.154   \n",
       "87    20.475517  Afghanistan                                  528.154   \n",
       "88    20.475517  Afghanistan                                  528.154   \n",
       "89    20.475517  Afghanistan                                  528.154   \n",
       "90    20.475517  Afghanistan                                  528.154   \n",
       "91    20.475517  Afghanistan                                  528.154   \n",
       "92    20.475517  Afghanistan                                  528.154   \n",
       "\n",
       "    Gross_domestic_product__current_prices  Gross_domestic_product__deflator  \\\n",
       "69                                 1692.57                           320.469   \n",
       "70                                 1692.57                           320.469   \n",
       "71                                 1692.57                           320.469   \n",
       "72                                 1692.57                           320.469   \n",
       "73                                 1692.57                           320.469   \n",
       "74                                 1692.57                           320.469   \n",
       "75                                 1692.57                           320.469   \n",
       "76                                 1692.57                           320.469   \n",
       "77                                 1692.57                           320.469   \n",
       "78                                 1692.57                           320.469   \n",
       "79                                 1692.57                           320.469   \n",
       "80                                 1692.57                           320.469   \n",
       "81                                 1692.57                           320.469   \n",
       "82                                 1692.57                           320.469   \n",
       "83                                 1692.57                           320.469   \n",
       "84                                 1692.57                           320.469   \n",
       "85                                 1692.57                           320.469   \n",
       "86                                 1692.57                           320.469   \n",
       "87                                 1692.57                           320.469   \n",
       "88                                 1692.57                           320.469   \n",
       "89                                 1692.57                           320.469   \n",
       "90                                 1692.57                           320.469   \n",
       "91                                 1692.57                           320.469   \n",
       "92                                 1692.57                           320.469   \n",
       "\n",
       "    Gross_domestic_product_per_capita__constant_prices  \\\n",
       "69                                           14300.19    \n",
       "70                                           14300.19    \n",
       "71                                           14300.19    \n",
       "72                                           14300.19    \n",
       "73                                           14300.19    \n",
       "74                                           14300.19    \n",
       "75                                           14300.19    \n",
       "76                                           14300.19    \n",
       "77                                           14300.19    \n",
       "78                                           14300.19    \n",
       "79                                           14300.19    \n",
       "80                                           14300.19    \n",
       "81                                           14300.19    \n",
       "82                                           14300.19    \n",
       "83                                           14300.19    \n",
       "84                                           14300.19    \n",
       "85                                           14300.19    \n",
       "86                                           14300.19    \n",
       "87                                           14300.19    \n",
       "88                                           14300.19    \n",
       "89                                           14300.19    \n",
       "90                                           14300.19    \n",
       "91                                           14300.19    \n",
       "92                                           14300.19    \n",
       "\n",
       "    Gross_domestic_product_per_capita__current_prices  \\\n",
       "69                                           45827.64   \n",
       "70                                           45827.64   \n",
       "71                                           45827.64   \n",
       "72                                           45827.64   \n",
       "73                                           45827.64   \n",
       "74                                           45827.64   \n",
       "75                                           45827.64   \n",
       "76                                           45827.64   \n",
       "77                                           45827.64   \n",
       "78                                           45827.64   \n",
       "79                                           45827.64   \n",
       "80                                           45827.64   \n",
       "81                                           45827.64   \n",
       "82                                           45827.64   \n",
       "83                                           45827.64   \n",
       "84                                           45827.64   \n",
       "85                                           45827.64   \n",
       "86                                           45827.64   \n",
       "87                                           45827.64   \n",
       "88                                           45827.64   \n",
       "89                                           45827.64   \n",
       "90                                           45827.64   \n",
       "91                                           45827.64   \n",
       "92                                           45827.64   \n",
       "\n",
       "    Output_gap_in_percent_of_potential_GDP  \\\n",
       "69                                     NaN   \n",
       "70                                     NaN   \n",
       "71                                     NaN   \n",
       "72                                     NaN   \n",
       "73                                     NaN   \n",
       "74                                     NaN   \n",
       "75                                     NaN   \n",
       "76                                     NaN   \n",
       "77                                     NaN   \n",
       "78                                     NaN   \n",
       "79                                     NaN   \n",
       "80                                     NaN   \n",
       "81                                     NaN   \n",
       "82                                     NaN   \n",
       "83                                     NaN   \n",
       "84                                     NaN   \n",
       "85                                     NaN   \n",
       "86                                     NaN   \n",
       "87                                     NaN   \n",
       "88                                     NaN   \n",
       "89                                     NaN   \n",
       "90                                     NaN   \n",
       "91                                     NaN   \n",
       "92                                     NaN   \n",
       "\n",
       "    Gross_domestic_product_based_on_purchasing_power_parity__PPP__valuation_of_country_GDP  \\\n",
       "69                                              75.87                                        \n",
       "70                                              75.87                                        \n",
       "71                                              75.87                                        \n",
       "72                                              75.87                                        \n",
       "73                                              75.87                                        \n",
       "74                                              75.87                                        \n",
       "75                                              75.87                                        \n",
       "76                                              75.87                                        \n",
       "77                                              75.87                                        \n",
       "78                                              75.87                                        \n",
       "79                                              75.87                                        \n",
       "80                                              75.87                                        \n",
       "81                                              75.87                                        \n",
       "82                                              75.87                                        \n",
       "83                                              75.87                                        \n",
       "84                                              75.87                                        \n",
       "85                                              75.87                                        \n",
       "86                                              75.87                                        \n",
       "87                                              75.87                                        \n",
       "88                                              75.87                                        \n",
       "89                                              75.87                                        \n",
       "90                                              75.87                                        \n",
       "91                                              75.87                                        \n",
       "92                                              75.87                                        \n",
       "\n",
       "    Gross_domestic_product_based_on_purchasing_power_parity__PPP__per_capita_GDP  \\\n",
       "69                                            2054.23                              \n",
       "70                                            2054.23                              \n",
       "71                                            2054.23                              \n",
       "72                                            2054.23                              \n",
       "73                                            2054.23                              \n",
       "74                                            2054.23                              \n",
       "75                                            2054.23                              \n",
       "76                                            2054.23                              \n",
       "77                                            2054.23                              \n",
       "78                                            2054.23                              \n",
       "79                                            2054.23                              \n",
       "80                                            2054.23                              \n",
       "81                                            2054.23                              \n",
       "82                                            2054.23                              \n",
       "83                                            2054.23                              \n",
       "84                                            2054.23                              \n",
       "85                                            2054.23                              \n",
       "86                                            2054.23                              \n",
       "87                                            2054.23                              \n",
       "88                                            2054.23                              \n",
       "89                                            2054.23                              \n",
       "90                                            2054.23                              \n",
       "91                                            2054.23                              \n",
       "92                                            2054.23                              \n",
       "\n",
       "    Gross_domestic_product_based_on_purchasing_power_parity__PPP__share_of_world_total  \\\n",
       "69                                              0.053                                    \n",
       "70                                              0.053                                    \n",
       "71                                              0.053                                    \n",
       "72                                              0.053                                    \n",
       "73                                              0.053                                    \n",
       "74                                              0.053                                    \n",
       "75                                              0.053                                    \n",
       "76                                              0.053                                    \n",
       "77                                              0.053                                    \n",
       "78                                              0.053                                    \n",
       "79                                              0.053                                    \n",
       "80                                              0.053                                    \n",
       "81                                              0.053                                    \n",
       "82                                              0.053                                    \n",
       "83                                              0.053                                    \n",
       "84                                              0.053                                    \n",
       "85                                              0.053                                    \n",
       "86                                              0.053                                    \n",
       "87                                              0.053                                    \n",
       "88                                              0.053                                    \n",
       "89                                              0.053                                    \n",
       "90                                              0.053                                    \n",
       "91                                              0.053                                    \n",
       "92                                              0.053                                    \n",
       "\n",
       "    Implied_PPP_conversion_rate  Total_investment  Gross_national_savings  \\\n",
       "69                       22.309            18.346                  20.174   \n",
       "70                       22.309            18.346                  20.174   \n",
       "71                       22.309            18.346                  20.174   \n",
       "72                       22.309            18.346                  20.174   \n",
       "73                       22.309            18.346                  20.174   \n",
       "74                       22.309            18.346                  20.174   \n",
       "75                       22.309            18.346                  20.174   \n",
       "76                       22.309            18.346                  20.174   \n",
       "77                       22.309            18.346                  20.174   \n",
       "78                       22.309            18.346                  20.174   \n",
       "79                       22.309            18.346                  20.174   \n",
       "80                       22.309            18.346                  20.174   \n",
       "81                       22.309            18.346                  20.174   \n",
       "82                       22.309            18.346                  20.174   \n",
       "83                       22.309            18.346                  20.174   \n",
       "84                       22.309            18.346                  20.174   \n",
       "85                       22.309            18.346                  20.174   \n",
       "86                       22.309            18.346                  20.174   \n",
       "87                       22.309            18.346                  20.174   \n",
       "88                       22.309            18.346                  20.174   \n",
       "89                       22.309            18.346                  20.174   \n",
       "90                       22.309            18.346                  20.174   \n",
       "91                       22.309            18.346                  20.174   \n",
       "92                       22.309            18.346                  20.174   \n",
       "\n",
       "    Inflation__average_consumer_prices  \\\n",
       "69                             124.809   \n",
       "70                             124.809   \n",
       "71                             124.809   \n",
       "72                             124.809   \n",
       "73                             124.809   \n",
       "74                             124.809   \n",
       "75                             124.809   \n",
       "76                             124.809   \n",
       "77                             124.809   \n",
       "78                             124.809   \n",
       "79                             124.809   \n",
       "80                             124.809   \n",
       "81                             124.809   \n",
       "82                             124.809   \n",
       "83                             124.809   \n",
       "84                             124.809   \n",
       "85                             124.809   \n",
       "86                             124.809   \n",
       "87                             124.809   \n",
       "88                             124.809   \n",
       "89                             124.809   \n",
       "90                             124.809   \n",
       "91                             124.809   \n",
       "92                             124.809   \n",
       "\n",
       "    Inflation__end_of_period_consumer_prices  \\\n",
       "69                                    131.29   \n",
       "70                                    131.29   \n",
       "71                                    131.29   \n",
       "72                                    131.29   \n",
       "73                                    131.29   \n",
       "74                                    131.29   \n",
       "75                                    131.29   \n",
       "76                                    131.29   \n",
       "77                                    131.29   \n",
       "78                                    131.29   \n",
       "79                                    131.29   \n",
       "80                                    131.29   \n",
       "81                                    131.29   \n",
       "82                                    131.29   \n",
       "83                                    131.29   \n",
       "84                                    131.29   \n",
       "85                                    131.29   \n",
       "86                                    131.29   \n",
       "87                                    131.29   \n",
       "88                                    131.29   \n",
       "89                                    131.29   \n",
       "90                                    131.29   \n",
       "91                                    131.29   \n",
       "92                                    131.29   \n",
       "\n",
       "    Six_month_London_interbank_offered_rate__LIBOR_  \\\n",
       "69                                              NaN   \n",
       "70                                              NaN   \n",
       "71                                              NaN   \n",
       "72                                              NaN   \n",
       "73                                              NaN   \n",
       "74                                              NaN   \n",
       "75                                              NaN   \n",
       "76                                              NaN   \n",
       "77                                              NaN   \n",
       "78                                              NaN   \n",
       "79                                              NaN   \n",
       "80                                              NaN   \n",
       "81                                              NaN   \n",
       "82                                              NaN   \n",
       "83                                              NaN   \n",
       "84                                              NaN   \n",
       "85                                              NaN   \n",
       "86                                              NaN   \n",
       "87                                              NaN   \n",
       "88                                              NaN   \n",
       "89                                              NaN   \n",
       "90                                              NaN   \n",
       "91                                              NaN   \n",
       "92                                              NaN   \n",
       "\n",
       "    Volume_of_imports_of_goods_and_services  Volume_of_Imports_of_goods  \\\n",
       "69                                    3.559                       2.773   \n",
       "70                                    3.559                       2.773   \n",
       "71                                    3.559                       2.773   \n",
       "72                                    3.559                       2.773   \n",
       "73                                    3.559                       2.773   \n",
       "74                                    3.559                       2.773   \n",
       "75                                    3.559                       2.773   \n",
       "76                                    3.559                       2.773   \n",
       "77                                    3.559                       2.773   \n",
       "78                                    3.559                       2.773   \n",
       "79                                    3.559                       2.773   \n",
       "80                                    3.559                       2.773   \n",
       "81                                    3.559                       2.773   \n",
       "82                                    3.559                       2.773   \n",
       "83                                    3.559                       2.773   \n",
       "84                                    3.559                       2.773   \n",
       "85                                    3.559                       2.773   \n",
       "86                                    3.559                       2.773   \n",
       "87                                    3.559                       2.773   \n",
       "88                                    3.559                       2.773   \n",
       "89                                    3.559                       2.773   \n",
       "90                                    3.559                       2.773   \n",
       "91                                    3.559                       2.773   \n",
       "92                                    3.559                       2.773   \n",
       "\n",
       "    Volume_of_exports_of_goods_and_services  Volume_of_exports_of_goods  \\\n",
       "69                                   13.252                      17.026   \n",
       "70                                   13.252                      17.026   \n",
       "71                                   13.252                      17.026   \n",
       "72                                   13.252                      17.026   \n",
       "73                                   13.252                      17.026   \n",
       "74                                   13.252                      17.026   \n",
       "75                                   13.252                      17.026   \n",
       "76                                   13.252                      17.026   \n",
       "77                                   13.252                      17.026   \n",
       "78                                   13.252                      17.026   \n",
       "79                                   13.252                      17.026   \n",
       "80                                   13.252                      17.026   \n",
       "81                                   13.252                      17.026   \n",
       "82                                   13.252                      17.026   \n",
       "83                                   13.252                      17.026   \n",
       "84                                   13.252                      17.026   \n",
       "85                                   13.252                      17.026   \n",
       "86                                   13.252                      17.026   \n",
       "87                                   13.252                      17.026   \n",
       "88                                   13.252                      17.026   \n",
       "89                                   13.252                      17.026   \n",
       "90                                   13.252                      17.026   \n",
       "91                                   13.252                      17.026   \n",
       "92                                   13.252                      17.026   \n",
       "\n",
       "    Unemployment_rate  Employment  Population  General_government_revenue  \\\n",
       "69                NaN         NaN      36.933                      469.79   \n",
       "70                NaN         NaN      36.933                      469.79   \n",
       "71                NaN         NaN      36.933                      469.79   \n",
       "72                NaN         NaN      36.933                      469.79   \n",
       "73                NaN         NaN      36.933                      469.79   \n",
       "74                NaN         NaN      36.933                      469.79   \n",
       "75                NaN         NaN      36.933                      469.79   \n",
       "76                NaN         NaN      36.933                      469.79   \n",
       "77                NaN         NaN      36.933                      469.79   \n",
       "78                NaN         NaN      36.933                      469.79   \n",
       "79                NaN         NaN      36.933                      469.79   \n",
       "80                NaN         NaN      36.933                      469.79   \n",
       "81                NaN         NaN      36.933                      469.79   \n",
       "82                NaN         NaN      36.933                      469.79   \n",
       "83                NaN         NaN      36.933                      469.79   \n",
       "84                NaN         NaN      36.933                      469.79   \n",
       "85                NaN         NaN      36.933                      469.79   \n",
       "86                NaN         NaN      36.933                      469.79   \n",
       "87                NaN         NaN      36.933                      469.79   \n",
       "88                NaN         NaN      36.933                      469.79   \n",
       "89                NaN         NaN      36.933                      469.79   \n",
       "90                NaN         NaN      36.933                      469.79   \n",
       "91                NaN         NaN      36.933                      469.79   \n",
       "92                NaN         NaN      36.933                      469.79   \n",
       "\n",
       "    General_government_total_expenditure  \\\n",
       "69                                467.62   \n",
       "70                                467.62   \n",
       "71                                467.62   \n",
       "72                                467.62   \n",
       "73                                467.62   \n",
       "74                                467.62   \n",
       "75                                467.62   \n",
       "76                                467.62   \n",
       "77                                467.62   \n",
       "78                                467.62   \n",
       "79                                467.62   \n",
       "80                                467.62   \n",
       "81                                467.62   \n",
       "82                                467.62   \n",
       "83                                467.62   \n",
       "84                                467.62   \n",
       "85                                467.62   \n",
       "86                                467.62   \n",
       "87                                467.62   \n",
       "88                                467.62   \n",
       "89                                467.62   \n",
       "90                                467.62   \n",
       "91                                467.62   \n",
       "92                                467.62   \n",
       "\n",
       "    General_government_net_lending_borrowing  \\\n",
       "69                                      2.17   \n",
       "70                                      2.17   \n",
       "71                                      2.17   \n",
       "72                                      2.17   \n",
       "73                                      2.17   \n",
       "74                                      2.17   \n",
       "75                                      2.17   \n",
       "76                                      2.17   \n",
       "77                                      2.17   \n",
       "78                                      2.17   \n",
       "79                                      2.17   \n",
       "80                                      2.17   \n",
       "81                                      2.17   \n",
       "82                                      2.17   \n",
       "83                                      2.17   \n",
       "84                                      2.17   \n",
       "85                                      2.17   \n",
       "86                                      2.17   \n",
       "87                                      2.17   \n",
       "88                                      2.17   \n",
       "89                                      2.17   \n",
       "90                                      2.17   \n",
       "91                                      2.17   \n",
       "92                                      2.17   \n",
       "\n",
       "    General_government_structural_balance  \\\n",
       "69                                    NaN   \n",
       "70                                    NaN   \n",
       "71                                    NaN   \n",
       "72                                    NaN   \n",
       "73                                    NaN   \n",
       "74                                    NaN   \n",
       "75                                    NaN   \n",
       "76                                    NaN   \n",
       "77                                    NaN   \n",
       "78                                    NaN   \n",
       "79                                    NaN   \n",
       "80                                    NaN   \n",
       "81                                    NaN   \n",
       "82                                    NaN   \n",
       "83                                    NaN   \n",
       "84                                    NaN   \n",
       "85                                    NaN   \n",
       "86                                    NaN   \n",
       "87                                    NaN   \n",
       "88                                    NaN   \n",
       "89                                    NaN   \n",
       "90                                    NaN   \n",
       "91                                    NaN   \n",
       "92                                    NaN   \n",
       "\n",
       "    General_government_primary_net_lending_borrowing  \\\n",
       "69                                             2.532   \n",
       "70                                             2.532   \n",
       "71                                             2.532   \n",
       "72                                             2.532   \n",
       "73                                             2.532   \n",
       "74                                             2.532   \n",
       "75                                             2.532   \n",
       "76                                             2.532   \n",
       "77                                             2.532   \n",
       "78                                             2.532   \n",
       "79                                             2.532   \n",
       "80                                             2.532   \n",
       "81                                             2.532   \n",
       "82                                             2.532   \n",
       "83                                             2.532   \n",
       "84                                             2.532   \n",
       "85                                             2.532   \n",
       "86                                             2.532   \n",
       "87                                             2.532   \n",
       "88                                             2.532   \n",
       "89                                             2.532   \n",
       "90                                             2.532   \n",
       "91                                             2.532   \n",
       "92                                             2.532   \n",
       "\n",
       "    General_government_net_debt  General_government_gross_debt  \\\n",
       "69                          NaN                        101.669   \n",
       "70                          NaN                        101.669   \n",
       "71                          NaN                        101.669   \n",
       "72                          NaN                        101.669   \n",
       "73                          NaN                        101.669   \n",
       "74                          NaN                        101.669   \n",
       "75                          NaN                        101.669   \n",
       "76                          NaN                        101.669   \n",
       "77                          NaN                        101.669   \n",
       "78                          NaN                        101.669   \n",
       "79                          NaN                        101.669   \n",
       "80                          NaN                        101.669   \n",
       "81                          NaN                        101.669   \n",
       "82                          NaN                        101.669   \n",
       "83                          NaN                        101.669   \n",
       "84                          NaN                        101.669   \n",
       "85                          NaN                        101.669   \n",
       "86                          NaN                        101.669   \n",
       "87                          NaN                        101.669   \n",
       "88                          NaN                        101.669   \n",
       "89                          NaN                        101.669   \n",
       "90                          NaN                        101.669   \n",
       "91                          NaN                        101.669   \n",
       "92                          NaN                        101.669   \n",
       "\n",
       "    Gross_domestic_product_corresponding_to_fiscal_year__current_prices  \\\n",
       "69                                            1692.57                     \n",
       "70                                            1692.57                     \n",
       "71                                            1692.57                     \n",
       "72                                            1692.57                     \n",
       "73                                            1692.57                     \n",
       "74                                            1692.57                     \n",
       "75                                            1692.57                     \n",
       "76                                            1692.57                     \n",
       "77                                            1692.57                     \n",
       "78                                            1692.57                     \n",
       "79                                            1692.57                     \n",
       "80                                            1692.57                     \n",
       "81                                            1692.57                     \n",
       "82                                            1692.57                     \n",
       "83                                            1692.57                     \n",
       "84                                            1692.57                     \n",
       "85                                            1692.57                     \n",
       "86                                            1692.57                     \n",
       "87                                            1692.57                     \n",
       "88                                            1692.57                     \n",
       "89                                            1692.57                     \n",
       "90                                            1692.57                     \n",
       "91                                            1692.57                     \n",
       "92                                            1692.57                     \n",
       "\n",
       "    Current_account_balance  LifeExpectancy         pop  density  medianage  \\\n",
       "69                    0.425            64.5  38928346.0     60.0       18.0   \n",
       "70                    0.425            64.5  38928346.0     60.0       18.0   \n",
       "71                    0.425            64.5  38928346.0     60.0       18.0   \n",
       "72                    0.425            64.5  38928346.0     60.0       18.0   \n",
       "73                    0.425            64.5  38928346.0     60.0       18.0   \n",
       "74                    0.425            64.5  38928346.0     60.0       18.0   \n",
       "75                    0.425            64.5  38928346.0     60.0       18.0   \n",
       "76                    0.425            64.5  38928346.0     60.0       18.0   \n",
       "77                    0.425            64.5  38928346.0     60.0       18.0   \n",
       "78                    0.425            64.5  38928346.0     60.0       18.0   \n",
       "79                    0.425            64.5  38928346.0     60.0       18.0   \n",
       "80                    0.425            64.5  38928346.0     60.0       18.0   \n",
       "81                    0.425            64.5  38928346.0     60.0       18.0   \n",
       "82                    0.425            64.5  38928346.0     60.0       18.0   \n",
       "83                    0.425            64.5  38928346.0     60.0       18.0   \n",
       "84                    0.425            64.5  38928346.0     60.0       18.0   \n",
       "85                    0.425            64.5  38928346.0     60.0       18.0   \n",
       "86                    0.425            64.5  38928346.0     60.0       18.0   \n",
       "87                    0.425            64.5  38928346.0     60.0       18.0   \n",
       "88                    0.425            64.5  38928346.0     60.0       18.0   \n",
       "89                    0.425            64.5  38928346.0     60.0       18.0   \n",
       "90                    0.425            64.5  38928346.0     60.0       18.0   \n",
       "91                    0.425            64.5  38928346.0     60.0       18.0   \n",
       "92                    0.425            64.5  38928346.0     60.0       18.0   \n",
       "\n",
       "    urbanpop quarantine schools  hospibed  smokers  sex0  sex14  sex25  sex54  \\\n",
       "69      25.0        NaN     NaN       0.5      NaN  1.05   1.03   1.03   1.03   \n",
       "70      25.0        NaN     NaN       0.5      NaN  1.05   1.03   1.03   1.03   \n",
       "71      25.0        NaN     NaN       0.5      NaN  1.05   1.03   1.03   1.03   \n",
       "72      25.0        NaN     NaN       0.5      NaN  1.05   1.03   1.03   1.03   \n",
       "73      25.0        NaN     NaN       0.5      NaN  1.05   1.03   1.03   1.03   \n",
       "74      25.0        NaN     NaN       0.5      NaN  1.05   1.03   1.03   1.03   \n",
       "75      25.0        NaN     NaN       0.5      NaN  1.05   1.03   1.03   1.03   \n",
       "76      25.0        NaN     NaN       0.5      NaN  1.05   1.03   1.03   1.03   \n",
       "77      25.0        NaN     NaN       0.5      NaN  1.05   1.03   1.03   1.03   \n",
       "78      25.0        NaN     NaN       0.5      NaN  1.05   1.03   1.03   1.03   \n",
       "79      25.0        NaN     NaN       0.5      NaN  1.05   1.03   1.03   1.03   \n",
       "80      25.0        NaN     NaN       0.5      NaN  1.05   1.03   1.03   1.03   \n",
       "81      25.0        NaN     NaN       0.5      NaN  1.05   1.03   1.03   1.03   \n",
       "82      25.0        NaN     NaN       0.5      NaN  1.05   1.03   1.03   1.03   \n",
       "83      25.0        NaN     NaN       0.5      NaN  1.05   1.03   1.03   1.03   \n",
       "84      25.0        NaN     NaN       0.5      NaN  1.05   1.03   1.03   1.03   \n",
       "85      25.0        NaN     NaN       0.5      NaN  1.05   1.03   1.03   1.03   \n",
       "86      25.0        NaN     NaN       0.5      NaN  1.05   1.03   1.03   1.03   \n",
       "87      25.0        NaN     NaN       0.5      NaN  1.05   1.03   1.03   1.03   \n",
       "88      25.0        NaN     NaN       0.5      NaN  1.05   1.03   1.03   1.03   \n",
       "89      25.0        NaN     NaN       0.5      NaN  1.05   1.03   1.03   1.03   \n",
       "90      25.0        NaN     NaN       0.5      NaN  1.05   1.03   1.03   1.03   \n",
       "91      25.0        NaN     NaN       0.5      NaN  1.05   1.03   1.03   1.03   \n",
       "92      25.0        NaN     NaN       0.5      NaN  1.05   1.03   1.03   1.03   \n",
       "\n",
       "    sex64  sex65plus  sexratio   lung  femalelung  malelung   id  \\\n",
       "69   0.97       0.85      1.03  37.62       36.31     39.33   82   \n",
       "70   0.97       0.85      1.03  37.62       36.31     39.33   83   \n",
       "71   0.97       0.85      1.03  37.62       36.31     39.33   84   \n",
       "72   0.97       0.85      1.03  37.62       36.31     39.33   85   \n",
       "73   0.97       0.85      1.03  37.62       36.31     39.33   86   \n",
       "74   0.97       0.85      1.03  37.62       36.31     39.33   87   \n",
       "75   0.97       0.85      1.03  37.62       36.31     39.33   88   \n",
       "76   0.97       0.85      1.03  37.62       36.31     39.33   89   \n",
       "77   0.97       0.85      1.03  37.62       36.31     39.33   90   \n",
       "78   0.97       0.85      1.03  37.62       36.31     39.33   91   \n",
       "79   0.97       0.85      1.03  37.62       36.31     39.33   92   \n",
       "80   0.97       0.85      1.03  37.62       36.31     39.33   93   \n",
       "81   0.97       0.85      1.03  37.62       36.31     39.33   94   \n",
       "82   0.97       0.85      1.03  37.62       36.31     39.33   95   \n",
       "83   0.97       0.85      1.03  37.62       36.31     39.33   96   \n",
       "84   0.97       0.85      1.03  37.62       36.31     39.33   97   \n",
       "85   0.97       0.85      1.03  37.62       36.31     39.33   98   \n",
       "86   0.97       0.85      1.03  37.62       36.31     39.33   99   \n",
       "87   0.97       0.85      1.03  37.62       36.31     39.33  100   \n",
       "88   0.97       0.85      1.03  37.62       36.31     39.33  101   \n",
       "89   0.97       0.85      1.03  37.62       36.31     39.33  102   \n",
       "90   0.97       0.85      1.03  37.62       36.31     39.33  103   \n",
       "91   0.97       0.85      1.03  37.62       36.31     39.33  104   \n",
       "92   0.97       0.85      1.03  37.62       36.31     39.33  105   \n",
       "\n",
       "    Country/Region_le  Province/State_le  cases/day-(1-1)  cases/day-(1-7)  \\\n",
       "69                 23                  0         0.587366         0.752590   \n",
       "70                 23                  0         0.587366         0.725053   \n",
       "71                 23                  0         0.587366         0.697516   \n",
       "72                 23                  0         0.587366         0.669978   \n",
       "73                 23                  0         0.587366         0.642441   \n",
       "74                 23                  0         0.587366         0.614903   \n",
       "75                 23                  0         0.587366         0.587366   \n",
       "76                 23                  0         0.587366         0.587366   \n",
       "77                 23                  0         0.587366         0.587366   \n",
       "78                 23                  0         0.587366         0.587366   \n",
       "79                 23                  0         0.587366         0.587366   \n",
       "80                 23                  0         0.587366         0.587366   \n",
       "81                 23                  0         0.587366         0.587366   \n",
       "82                 23                  0         0.587366         0.587366   \n",
       "83                 23                  0         0.562330         0.583789   \n",
       "84                 23                  0         0.562330         0.580213   \n",
       "85                 23                  0         0.562330         0.576636   \n",
       "86                 23                  0         0.562330         0.573059   \n",
       "87                 23                  0         0.562330         0.569483   \n",
       "88                 23                  0         0.562330         0.565906   \n",
       "89                 23                  0         0.562330         0.562330   \n",
       "90                 23                  0         0.562330         0.562330   \n",
       "91                 23                  0         0.562330         0.562330   \n",
       "92                 23                  0         0.562330         0.562330   \n",
       "\n",
       "    cases/day-(8-14)  cases/day-(15-21)  fatal/day-(1-1)  fatal/day-(1-7)  \\\n",
       "69          0.827440           1.012243          0.05456          0.05456   \n",
       "70          0.829316           0.978957          0.05456          0.05456   \n",
       "71          0.826322           0.807683          0.05456          0.05456   \n",
       "72          0.814773           0.802521          0.05456          0.05456   \n",
       "73          0.803225           0.814934          0.05456          0.05456   \n",
       "74          0.791676           0.820249          0.05456          0.05456   \n",
       "75          0.780128           0.825564          0.05456          0.05456   \n",
       "76          0.752590           0.827440          0.05456          0.05456   \n",
       "77          0.725053           0.829316          0.05456          0.05456   \n",
       "78          0.697516           0.826322          0.05456          0.05456   \n",
       "79          0.669978           0.814773          0.05456          0.05456   \n",
       "80          0.642441           0.803225          0.05456          0.05456   \n",
       "81          0.614903           0.791676          0.05456          0.05456   \n",
       "82          0.587366           0.780128          0.05456          0.05456   \n",
       "83          0.587366           0.752590          0.05456          0.05456   \n",
       "84          0.587366           0.725053          0.05456          0.05456   \n",
       "85          0.587366           0.697516          0.05456          0.05456   \n",
       "86          0.587366           0.669978          0.05456          0.05456   \n",
       "87          0.587366           0.642441          0.05456          0.05456   \n",
       "88          0.587366           0.614903          0.05456          0.05456   \n",
       "89          0.587366           0.587366          0.05456          0.05456   \n",
       "90          0.583789           0.587366          0.05456          0.05456   \n",
       "91          0.580213           0.587366          0.05456          0.05456   \n",
       "92          0.576636           0.587366          0.05456          0.05456   \n",
       "\n",
       "    fatal/day-(8-14)  fatal/day-(15-21)  days_since_1cases  \\\n",
       "69           0.05456           0.032229                 36   \n",
       "70           0.05456           0.040024                 37   \n",
       "71           0.05456           0.047818                 38   \n",
       "72           0.05456           0.054560                 39   \n",
       "73           0.05456           0.054560                 40   \n",
       "74           0.05456           0.054560                 41   \n",
       "75           0.05456           0.054560                 42   \n",
       "76           0.05456           0.054560                 43   \n",
       "77           0.05456           0.054560                 44   \n",
       "78           0.05456           0.054560                 45   \n",
       "79           0.05456           0.054560                 46   \n",
       "80           0.05456           0.054560                 47   \n",
       "81           0.05456           0.054560                 48   \n",
       "82           0.05456           0.054560                 49   \n",
       "83           0.05456           0.054560                 50   \n",
       "84           0.05456           0.054560                 51   \n",
       "85           0.05456           0.054560                 52   \n",
       "86           0.05456           0.054560                 53   \n",
       "87           0.05456           0.054560                 54   \n",
       "88           0.05456           0.054560                 55   \n",
       "89           0.05456           0.054560                 56   \n",
       "90           0.05456           0.054560                 57   \n",
       "91           0.05456           0.054560                 58   \n",
       "92           0.05456           0.054560                 59   \n",
       "\n",
       "    days_since_10cases  days_since_100cases  days_since_1fatal  \\\n",
       "69                  16                    0                  0   \n",
       "70                  17                    0                  1   \n",
       "71                  18                    0                  2   \n",
       "72                  19                    0                  3   \n",
       "73                  20                    0                  4   \n",
       "74                  21                    0                  5   \n",
       "75                  22                    0                  6   \n",
       "76                  23                    0                  7   \n",
       "77                  24                    0                  8   \n",
       "78                  25                    0                  9   \n",
       "79                  26                    0                 10   \n",
       "80                  27                    0                 11   \n",
       "81                  28                    0                 12   \n",
       "82                  29                    0                 13   \n",
       "83                  30                    0                 14   \n",
       "84                  31                    0                 15   \n",
       "85                  32                    0                 16   \n",
       "86                  33                    0                 17   \n",
       "87                  34                    0                 18   \n",
       "88                  35                    0                 19   \n",
       "89                  36                    0                 20   \n",
       "90                  37                    0                 21   \n",
       "91                  38                    0                 22   \n",
       "92                  39                    0                 23   \n",
       "\n",
       "    days_since_10fatal  days_since_100fatal  \n",
       "69                   0                    0  \n",
       "70                   0                    0  \n",
       "71                   0                    0  \n",
       "72                   0                    0  \n",
       "73                   0                    0  \n",
       "74                   0                    0  \n",
       "75                   0                    0  \n",
       "76                   0                    0  \n",
       "77                   0                    0  \n",
       "78                   0                    0  \n",
       "79                   0                    0  \n",
       "80                   0                    0  \n",
       "81                   0                    0  \n",
       "82                   0                    0  \n",
       "83                   0                    0  \n",
       "84                   0                    0  \n",
       "85                   0                    0  \n",
       "86                   0                    0  \n",
       "87                   0                    0  \n",
       "88                   0                    0  \n",
       "89                   0                    0  \n",
       "90                   0                    0  \n",
       "91                   0                    0  \n",
       "92                   0                    0  "
      ]
     },
     "execution_count": 209,
     "metadata": {},
     "output_type": "execute_result"
    }
   ],
   "source": [
    "df_interest[df_interest[\"day\"]>=91]"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 203,
   "metadata": {},
   "outputs": [
    {
     "name": "stdout",
     "output_type": "stream",
     "text": [
      "84\n"
     ]
    },
    {
     "name": "stderr",
     "output_type": "stream",
     "text": [
      "F:\\Anaconda\\lib\\site-packages\\ipykernel_launcher.py:6: SettingWithCopyWarning: \n",
      "A value is trying to be set on a copy of a slice from a DataFrame\n",
      "\n",
      "See the caveats in the documentation: https://pandas.pydata.org/pandas-docs/stable/user_guide/indexing.html#returning-a-view-versus-a-copy\n",
      "  \n",
      "F:\\Anaconda\\lib\\site-packages\\ipykernel_launcher.py:7: SettingWithCopyWarning: \n",
      "A value is trying to be set on a copy of a slice from a DataFrame\n",
      "\n",
      "See the caveats in the documentation: https://pandas.pydata.org/pandas-docs/stable/user_guide/indexing.html#returning-a-view-versus-a-copy\n",
      "  import sys\n"
     ]
    },
    {
     "data": {
      "text/html": [
       "<div>\n",
       "<style scoped>\n",
       "    .dataframe tbody tr th:only-of-type {\n",
       "        vertical-align: middle;\n",
       "    }\n",
       "\n",
       "    .dataframe tbody tr th {\n",
       "        vertical-align: top;\n",
       "    }\n",
       "\n",
       "    .dataframe thead th {\n",
       "        text-align: right;\n",
       "    }\n",
       "</style>\n",
       "<table border=\"1\" class=\"dataframe\">\n",
       "  <thead>\n",
       "    <tr style=\"text-align: right;\">\n",
       "      <th></th>\n",
       "      <th>Id</th>\n",
       "      <th>Province/State</th>\n",
       "      <th>Country/Region</th>\n",
       "      <th>Lat</th>\n",
       "      <th>Long</th>\n",
       "      <th>Date</th>\n",
       "      <th>ConfirmedCases</th>\n",
       "      <th>Fatalities</th>\n",
       "      <th>ForecastId</th>\n",
       "      <th>place_id</th>\n",
       "      <th>day</th>\n",
       "      <th>cases/day</th>\n",
       "      <th>fatal/day</th>\n",
       "      <th>SmokingRate</th>\n",
       "      <th>Country</th>\n",
       "      <th>Gross_domestic_product__constant_prices</th>\n",
       "      <th>Gross_domestic_product__current_prices</th>\n",
       "      <th>Gross_domestic_product__deflator</th>\n",
       "      <th>Gross_domestic_product_per_capita__constant_prices</th>\n",
       "      <th>Gross_domestic_product_per_capita__current_prices</th>\n",
       "      <th>Output_gap_in_percent_of_potential_GDP</th>\n",
       "      <th>Gross_domestic_product_based_on_purchasing_power_parity__PPP__valuation_of_country_GDP</th>\n",
       "      <th>Gross_domestic_product_based_on_purchasing_power_parity__PPP__per_capita_GDP</th>\n",
       "      <th>Gross_domestic_product_based_on_purchasing_power_parity__PPP__share_of_world_total</th>\n",
       "      <th>Implied_PPP_conversion_rate</th>\n",
       "      <th>Total_investment</th>\n",
       "      <th>Gross_national_savings</th>\n",
       "      <th>Inflation__average_consumer_prices</th>\n",
       "      <th>Inflation__end_of_period_consumer_prices</th>\n",
       "      <th>Six_month_London_interbank_offered_rate__LIBOR_</th>\n",
       "      <th>Volume_of_imports_of_goods_and_services</th>\n",
       "      <th>Volume_of_Imports_of_goods</th>\n",
       "      <th>Volume_of_exports_of_goods_and_services</th>\n",
       "      <th>Volume_of_exports_of_goods</th>\n",
       "      <th>Unemployment_rate</th>\n",
       "      <th>Employment</th>\n",
       "      <th>Population</th>\n",
       "      <th>General_government_revenue</th>\n",
       "      <th>General_government_total_expenditure</th>\n",
       "      <th>General_government_net_lending_borrowing</th>\n",
       "      <th>General_government_structural_balance</th>\n",
       "      <th>General_government_primary_net_lending_borrowing</th>\n",
       "      <th>General_government_net_debt</th>\n",
       "      <th>General_government_gross_debt</th>\n",
       "      <th>Gross_domestic_product_corresponding_to_fiscal_year__current_prices</th>\n",
       "      <th>Current_account_balance</th>\n",
       "      <th>LifeExpectancy</th>\n",
       "      <th>pop</th>\n",
       "      <th>density</th>\n",
       "      <th>medianage</th>\n",
       "      <th>urbanpop</th>\n",
       "      <th>quarantine</th>\n",
       "      <th>schools</th>\n",
       "      <th>hospibed</th>\n",
       "      <th>smokers</th>\n",
       "      <th>sex0</th>\n",
       "      <th>sex14</th>\n",
       "      <th>sex25</th>\n",
       "      <th>sex54</th>\n",
       "      <th>sex64</th>\n",
       "      <th>sex65plus</th>\n",
       "      <th>sexratio</th>\n",
       "      <th>lung</th>\n",
       "      <th>femalelung</th>\n",
       "      <th>malelung</th>\n",
       "      <th>id</th>\n",
       "      <th>Country/Region_le</th>\n",
       "      <th>Province/State_le</th>\n",
       "      <th>cases/day-(1-1)</th>\n",
       "      <th>cases/day-(1-7)</th>\n",
       "      <th>cases/day-(8-14)</th>\n",
       "      <th>cases/day-(15-21)</th>\n",
       "      <th>fatal/day-(1-1)</th>\n",
       "      <th>fatal/day-(1-7)</th>\n",
       "      <th>fatal/day-(8-14)</th>\n",
       "      <th>fatal/day-(15-21)</th>\n",
       "      <th>days_since_1cases</th>\n",
       "      <th>days_since_10cases</th>\n",
       "      <th>days_since_100cases</th>\n",
       "      <th>days_since_1fatal</th>\n",
       "      <th>days_since_10fatal</th>\n",
       "      <th>days_since_100fatal</th>\n",
       "    </tr>\n",
       "  </thead>\n",
       "  <tbody>\n",
       "    <tr>\n",
       "      <th>58</th>\n",
       "      <td>59.0</td>\n",
       "      <td>nan</td>\n",
       "      <td>Afghanistan</td>\n",
       "      <td>33.0</td>\n",
       "      <td>65.0</td>\n",
       "      <td>2020-03-20</td>\n",
       "      <td>24.0</td>\n",
       "      <td>0.0</td>\n",
       "      <td>NaN</td>\n",
       "      <td>Afghanistan</td>\n",
       "      <td>80</td>\n",
       "      <td>2.000000e+00</td>\n",
       "      <td>0.000000e+00</td>\n",
       "      <td>20.475517</td>\n",
       "      <td>Afghanistan</td>\n",
       "      <td>528.154</td>\n",
       "      <td>1692.57</td>\n",
       "      <td>320.469</td>\n",
       "      <td>14300.19</td>\n",
       "      <td>45827.64</td>\n",
       "      <td>NaN</td>\n",
       "      <td>75.87</td>\n",
       "      <td>2054.23</td>\n",
       "      <td>0.053</td>\n",
       "      <td>22.309</td>\n",
       "      <td>18.346</td>\n",
       "      <td>20.174</td>\n",
       "      <td>124.809</td>\n",
       "      <td>131.29</td>\n",
       "      <td>NaN</td>\n",
       "      <td>3.559</td>\n",
       "      <td>2.773</td>\n",
       "      <td>13.252</td>\n",
       "      <td>17.026</td>\n",
       "      <td>NaN</td>\n",
       "      <td>NaN</td>\n",
       "      <td>36.933</td>\n",
       "      <td>469.79</td>\n",
       "      <td>467.62</td>\n",
       "      <td>2.17</td>\n",
       "      <td>NaN</td>\n",
       "      <td>2.532</td>\n",
       "      <td>NaN</td>\n",
       "      <td>101.669</td>\n",
       "      <td>1692.57</td>\n",
       "      <td>0.425</td>\n",
       "      <td>64.5</td>\n",
       "      <td>38928346.0</td>\n",
       "      <td>60.0</td>\n",
       "      <td>18.0</td>\n",
       "      <td>25.0</td>\n",
       "      <td>NaN</td>\n",
       "      <td>NaN</td>\n",
       "      <td>0.5</td>\n",
       "      <td>NaN</td>\n",
       "      <td>1.05</td>\n",
       "      <td>1.03</td>\n",
       "      <td>1.03</td>\n",
       "      <td>1.03</td>\n",
       "      <td>0.97</td>\n",
       "      <td>0.85</td>\n",
       "      <td>1.03</td>\n",
       "      <td>37.62</td>\n",
       "      <td>36.31</td>\n",
       "      <td>39.33</td>\n",
       "      <td>58</td>\n",
       "      <td>23</td>\n",
       "      <td>0</td>\n",
       "      <td>0.000000e+00</td>\n",
       "      <td>2.142857e+00</td>\n",
       "      <td>0.857143</td>\n",
       "      <td>0.000000</td>\n",
       "      <td>0.000000e+00</td>\n",
       "      <td>0.000000e+00</td>\n",
       "      <td>0.0</td>\n",
       "      <td>0.0</td>\n",
       "      <td>25</td>\n",
       "      <td>6</td>\n",
       "      <td>0</td>\n",
       "      <td>0</td>\n",
       "      <td>0</td>\n",
       "      <td>0</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>59</th>\n",
       "      <td>60.0</td>\n",
       "      <td>nan</td>\n",
       "      <td>Afghanistan</td>\n",
       "      <td>33.0</td>\n",
       "      <td>65.0</td>\n",
       "      <td>2020-03-21</td>\n",
       "      <td>24.0</td>\n",
       "      <td>0.0</td>\n",
       "      <td>NaN</td>\n",
       "      <td>Afghanistan</td>\n",
       "      <td>81</td>\n",
       "      <td>0.000000e+00</td>\n",
       "      <td>0.000000e+00</td>\n",
       "      <td>20.475517</td>\n",
       "      <td>Afghanistan</td>\n",
       "      <td>528.154</td>\n",
       "      <td>1692.57</td>\n",
       "      <td>320.469</td>\n",
       "      <td>14300.19</td>\n",
       "      <td>45827.64</td>\n",
       "      <td>NaN</td>\n",
       "      <td>75.87</td>\n",
       "      <td>2054.23</td>\n",
       "      <td>0.053</td>\n",
       "      <td>22.309</td>\n",
       "      <td>18.346</td>\n",
       "      <td>20.174</td>\n",
       "      <td>124.809</td>\n",
       "      <td>131.29</td>\n",
       "      <td>NaN</td>\n",
       "      <td>3.559</td>\n",
       "      <td>2.773</td>\n",
       "      <td>13.252</td>\n",
       "      <td>17.026</td>\n",
       "      <td>NaN</td>\n",
       "      <td>NaN</td>\n",
       "      <td>36.933</td>\n",
       "      <td>469.79</td>\n",
       "      <td>467.62</td>\n",
       "      <td>2.17</td>\n",
       "      <td>NaN</td>\n",
       "      <td>2.532</td>\n",
       "      <td>NaN</td>\n",
       "      <td>101.669</td>\n",
       "      <td>1692.57</td>\n",
       "      <td>0.425</td>\n",
       "      <td>64.5</td>\n",
       "      <td>38928346.0</td>\n",
       "      <td>60.0</td>\n",
       "      <td>18.0</td>\n",
       "      <td>25.0</td>\n",
       "      <td>NaN</td>\n",
       "      <td>NaN</td>\n",
       "      <td>0.5</td>\n",
       "      <td>NaN</td>\n",
       "      <td>1.05</td>\n",
       "      <td>1.03</td>\n",
       "      <td>1.03</td>\n",
       "      <td>1.03</td>\n",
       "      <td>0.97</td>\n",
       "      <td>0.85</td>\n",
       "      <td>1.03</td>\n",
       "      <td>37.62</td>\n",
       "      <td>36.31</td>\n",
       "      <td>39.33</td>\n",
       "      <td>59</td>\n",
       "      <td>23</td>\n",
       "      <td>0</td>\n",
       "      <td>2.000000e+00</td>\n",
       "      <td>2.428571e+00</td>\n",
       "      <td>0.857143</td>\n",
       "      <td>0.000000</td>\n",
       "      <td>0.000000e+00</td>\n",
       "      <td>0.000000e+00</td>\n",
       "      <td>0.0</td>\n",
       "      <td>0.0</td>\n",
       "      <td>26</td>\n",
       "      <td>7</td>\n",
       "      <td>0</td>\n",
       "      <td>0</td>\n",
       "      <td>0</td>\n",
       "      <td>0</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>60</th>\n",
       "      <td>61.0</td>\n",
       "      <td>nan</td>\n",
       "      <td>Afghanistan</td>\n",
       "      <td>33.0</td>\n",
       "      <td>65.0</td>\n",
       "      <td>2020-03-22</td>\n",
       "      <td>40.0</td>\n",
       "      <td>1.0</td>\n",
       "      <td>NaN</td>\n",
       "      <td>Afghanistan</td>\n",
       "      <td>82</td>\n",
       "      <td>1.600000e+01</td>\n",
       "      <td>1.000000e+00</td>\n",
       "      <td>20.475517</td>\n",
       "      <td>Afghanistan</td>\n",
       "      <td>528.154</td>\n",
       "      <td>1692.57</td>\n",
       "      <td>320.469</td>\n",
       "      <td>14300.19</td>\n",
       "      <td>45827.64</td>\n",
       "      <td>NaN</td>\n",
       "      <td>75.87</td>\n",
       "      <td>2054.23</td>\n",
       "      <td>0.053</td>\n",
       "      <td>22.309</td>\n",
       "      <td>18.346</td>\n",
       "      <td>20.174</td>\n",
       "      <td>124.809</td>\n",
       "      <td>131.29</td>\n",
       "      <td>NaN</td>\n",
       "      <td>3.559</td>\n",
       "      <td>2.773</td>\n",
       "      <td>13.252</td>\n",
       "      <td>17.026</td>\n",
       "      <td>NaN</td>\n",
       "      <td>NaN</td>\n",
       "      <td>36.933</td>\n",
       "      <td>469.79</td>\n",
       "      <td>467.62</td>\n",
       "      <td>2.17</td>\n",
       "      <td>NaN</td>\n",
       "      <td>2.532</td>\n",
       "      <td>NaN</td>\n",
       "      <td>101.669</td>\n",
       "      <td>1692.57</td>\n",
       "      <td>0.425</td>\n",
       "      <td>64.5</td>\n",
       "      <td>38928346.0</td>\n",
       "      <td>60.0</td>\n",
       "      <td>18.0</td>\n",
       "      <td>25.0</td>\n",
       "      <td>NaN</td>\n",
       "      <td>NaN</td>\n",
       "      <td>0.5</td>\n",
       "      <td>NaN</td>\n",
       "      <td>1.05</td>\n",
       "      <td>1.03</td>\n",
       "      <td>1.03</td>\n",
       "      <td>1.03</td>\n",
       "      <td>0.97</td>\n",
       "      <td>0.85</td>\n",
       "      <td>1.03</td>\n",
       "      <td>37.62</td>\n",
       "      <td>36.31</td>\n",
       "      <td>39.33</td>\n",
       "      <td>60</td>\n",
       "      <td>23</td>\n",
       "      <td>0</td>\n",
       "      <td>0.000000e+00</td>\n",
       "      <td>1.857143e+00</td>\n",
       "      <td>1.428571</td>\n",
       "      <td>0.000000</td>\n",
       "      <td>0.000000e+00</td>\n",
       "      <td>0.000000e+00</td>\n",
       "      <td>0.0</td>\n",
       "      <td>0.0</td>\n",
       "      <td>27</td>\n",
       "      <td>8</td>\n",
       "      <td>0</td>\n",
       "      <td>0</td>\n",
       "      <td>0</td>\n",
       "      <td>0</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>61</th>\n",
       "      <td>62.0</td>\n",
       "      <td>nan</td>\n",
       "      <td>Afghanistan</td>\n",
       "      <td>33.0</td>\n",
       "      <td>65.0</td>\n",
       "      <td>2020-03-23</td>\n",
       "      <td>40.0</td>\n",
       "      <td>1.0</td>\n",
       "      <td>NaN</td>\n",
       "      <td>Afghanistan</td>\n",
       "      <td>83</td>\n",
       "      <td>0.000000e+00</td>\n",
       "      <td>0.000000e+00</td>\n",
       "      <td>20.475517</td>\n",
       "      <td>Afghanistan</td>\n",
       "      <td>528.154</td>\n",
       "      <td>1692.57</td>\n",
       "      <td>320.469</td>\n",
       "      <td>14300.19</td>\n",
       "      <td>45827.64</td>\n",
       "      <td>NaN</td>\n",
       "      <td>75.87</td>\n",
       "      <td>2054.23</td>\n",
       "      <td>0.053</td>\n",
       "      <td>22.309</td>\n",
       "      <td>18.346</td>\n",
       "      <td>20.174</td>\n",
       "      <td>124.809</td>\n",
       "      <td>131.29</td>\n",
       "      <td>NaN</td>\n",
       "      <td>3.559</td>\n",
       "      <td>2.773</td>\n",
       "      <td>13.252</td>\n",
       "      <td>17.026</td>\n",
       "      <td>NaN</td>\n",
       "      <td>NaN</td>\n",
       "      <td>36.933</td>\n",
       "      <td>469.79</td>\n",
       "      <td>467.62</td>\n",
       "      <td>2.17</td>\n",
       "      <td>NaN</td>\n",
       "      <td>2.532</td>\n",
       "      <td>NaN</td>\n",
       "      <td>101.669</td>\n",
       "      <td>1692.57</td>\n",
       "      <td>0.425</td>\n",
       "      <td>64.5</td>\n",
       "      <td>38928346.0</td>\n",
       "      <td>60.0</td>\n",
       "      <td>18.0</td>\n",
       "      <td>25.0</td>\n",
       "      <td>NaN</td>\n",
       "      <td>NaN</td>\n",
       "      <td>0.5</td>\n",
       "      <td>NaN</td>\n",
       "      <td>1.05</td>\n",
       "      <td>1.03</td>\n",
       "      <td>1.03</td>\n",
       "      <td>1.03</td>\n",
       "      <td>0.97</td>\n",
       "      <td>0.85</td>\n",
       "      <td>1.03</td>\n",
       "      <td>37.62</td>\n",
       "      <td>36.31</td>\n",
       "      <td>39.33</td>\n",
       "      <td>61</td>\n",
       "      <td>23</td>\n",
       "      <td>0</td>\n",
       "      <td>1.600000e+01</td>\n",
       "      <td>3.428571e+00</td>\n",
       "      <td>1.714286</td>\n",
       "      <td>0.428571</td>\n",
       "      <td>1.000000e+00</td>\n",
       "      <td>1.428571e-01</td>\n",
       "      <td>0.0</td>\n",
       "      <td>0.0</td>\n",
       "      <td>28</td>\n",
       "      <td>9</td>\n",
       "      <td>0</td>\n",
       "      <td>1</td>\n",
       "      <td>0</td>\n",
       "      <td>0</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>62</th>\n",
       "      <td>63.0</td>\n",
       "      <td>nan</td>\n",
       "      <td>Afghanistan</td>\n",
       "      <td>33.0</td>\n",
       "      <td>65.0</td>\n",
       "      <td>2020-03-24</td>\n",
       "      <td>74.0</td>\n",
       "      <td>1.0</td>\n",
       "      <td>NaN</td>\n",
       "      <td>Afghanistan</td>\n",
       "      <td>84</td>\n",
       "      <td>3.400000e+01</td>\n",
       "      <td>0.000000e+00</td>\n",
       "      <td>20.475517</td>\n",
       "      <td>Afghanistan</td>\n",
       "      <td>528.154</td>\n",
       "      <td>1692.57</td>\n",
       "      <td>320.469</td>\n",
       "      <td>14300.19</td>\n",
       "      <td>45827.64</td>\n",
       "      <td>NaN</td>\n",
       "      <td>75.87</td>\n",
       "      <td>2054.23</td>\n",
       "      <td>0.053</td>\n",
       "      <td>22.309</td>\n",
       "      <td>18.346</td>\n",
       "      <td>20.174</td>\n",
       "      <td>124.809</td>\n",
       "      <td>131.29</td>\n",
       "      <td>NaN</td>\n",
       "      <td>3.559</td>\n",
       "      <td>2.773</td>\n",
       "      <td>13.252</td>\n",
       "      <td>17.026</td>\n",
       "      <td>NaN</td>\n",
       "      <td>NaN</td>\n",
       "      <td>36.933</td>\n",
       "      <td>469.79</td>\n",
       "      <td>467.62</td>\n",
       "      <td>2.17</td>\n",
       "      <td>NaN</td>\n",
       "      <td>2.532</td>\n",
       "      <td>NaN</td>\n",
       "      <td>101.669</td>\n",
       "      <td>1692.57</td>\n",
       "      <td>0.425</td>\n",
       "      <td>64.5</td>\n",
       "      <td>38928346.0</td>\n",
       "      <td>60.0</td>\n",
       "      <td>18.0</td>\n",
       "      <td>25.0</td>\n",
       "      <td>NaN</td>\n",
       "      <td>NaN</td>\n",
       "      <td>0.5</td>\n",
       "      <td>NaN</td>\n",
       "      <td>1.05</td>\n",
       "      <td>1.03</td>\n",
       "      <td>1.03</td>\n",
       "      <td>1.03</td>\n",
       "      <td>0.97</td>\n",
       "      <td>0.85</td>\n",
       "      <td>1.03</td>\n",
       "      <td>37.62</td>\n",
       "      <td>36.31</td>\n",
       "      <td>39.33</td>\n",
       "      <td>62</td>\n",
       "      <td>23</td>\n",
       "      <td>0</td>\n",
       "      <td>0.000000e+00</td>\n",
       "      <td>2.714286e+00</td>\n",
       "      <td>2.428571</td>\n",
       "      <td>0.428571</td>\n",
       "      <td>0.000000e+00</td>\n",
       "      <td>1.428571e-01</td>\n",
       "      <td>0.0</td>\n",
       "      <td>0.0</td>\n",
       "      <td>29</td>\n",
       "      <td>10</td>\n",
       "      <td>0</td>\n",
       "      <td>2</td>\n",
       "      <td>0</td>\n",
       "      <td>0</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>63</th>\n",
       "      <td>NaN</td>\n",
       "      <td>nan</td>\n",
       "      <td>Afghanistan</td>\n",
       "      <td>33.0</td>\n",
       "      <td>65.0</td>\n",
       "      <td>2020-03-25</td>\n",
       "      <td>NaN</td>\n",
       "      <td>NaN</td>\n",
       "      <td>14.0</td>\n",
       "      <td>Afghanistan</td>\n",
       "      <td>85</td>\n",
       "      <td>-9.223372e+18</td>\n",
       "      <td>-9.223372e+18</td>\n",
       "      <td>20.475517</td>\n",
       "      <td>Afghanistan</td>\n",
       "      <td>528.154</td>\n",
       "      <td>1692.57</td>\n",
       "      <td>320.469</td>\n",
       "      <td>14300.19</td>\n",
       "      <td>45827.64</td>\n",
       "      <td>NaN</td>\n",
       "      <td>75.87</td>\n",
       "      <td>2054.23</td>\n",
       "      <td>0.053</td>\n",
       "      <td>22.309</td>\n",
       "      <td>18.346</td>\n",
       "      <td>20.174</td>\n",
       "      <td>124.809</td>\n",
       "      <td>131.29</td>\n",
       "      <td>NaN</td>\n",
       "      <td>3.559</td>\n",
       "      <td>2.773</td>\n",
       "      <td>13.252</td>\n",
       "      <td>17.026</td>\n",
       "      <td>NaN</td>\n",
       "      <td>NaN</td>\n",
       "      <td>36.933</td>\n",
       "      <td>469.79</td>\n",
       "      <td>467.62</td>\n",
       "      <td>2.17</td>\n",
       "      <td>NaN</td>\n",
       "      <td>2.532</td>\n",
       "      <td>NaN</td>\n",
       "      <td>101.669</td>\n",
       "      <td>1692.57</td>\n",
       "      <td>0.425</td>\n",
       "      <td>64.5</td>\n",
       "      <td>38928346.0</td>\n",
       "      <td>60.0</td>\n",
       "      <td>18.0</td>\n",
       "      <td>25.0</td>\n",
       "      <td>NaN</td>\n",
       "      <td>NaN</td>\n",
       "      <td>0.5</td>\n",
       "      <td>NaN</td>\n",
       "      <td>1.05</td>\n",
       "      <td>1.03</td>\n",
       "      <td>1.03</td>\n",
       "      <td>1.03</td>\n",
       "      <td>0.97</td>\n",
       "      <td>0.85</td>\n",
       "      <td>1.03</td>\n",
       "      <td>37.62</td>\n",
       "      <td>36.31</td>\n",
       "      <td>39.33</td>\n",
       "      <td>76</td>\n",
       "      <td>23</td>\n",
       "      <td>0</td>\n",
       "      <td>3.400000e+01</td>\n",
       "      <td>7.428571e+00</td>\n",
       "      <td>2.428571</td>\n",
       "      <td>0.571429</td>\n",
       "      <td>0.000000e+00</td>\n",
       "      <td>1.428571e-01</td>\n",
       "      <td>0.0</td>\n",
       "      <td>0.0</td>\n",
       "      <td>30</td>\n",
       "      <td>11</td>\n",
       "      <td>0</td>\n",
       "      <td>3</td>\n",
       "      <td>0</td>\n",
       "      <td>0</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>64</th>\n",
       "      <td>NaN</td>\n",
       "      <td>nan</td>\n",
       "      <td>Afghanistan</td>\n",
       "      <td>33.0</td>\n",
       "      <td>65.0</td>\n",
       "      <td>2020-03-26</td>\n",
       "      <td>NaN</td>\n",
       "      <td>NaN</td>\n",
       "      <td>15.0</td>\n",
       "      <td>Afghanistan</td>\n",
       "      <td>86</td>\n",
       "      <td>-9.223372e+18</td>\n",
       "      <td>-9.223372e+18</td>\n",
       "      <td>20.475517</td>\n",
       "      <td>Afghanistan</td>\n",
       "      <td>528.154</td>\n",
       "      <td>1692.57</td>\n",
       "      <td>320.469</td>\n",
       "      <td>14300.19</td>\n",
       "      <td>45827.64</td>\n",
       "      <td>NaN</td>\n",
       "      <td>75.87</td>\n",
       "      <td>2054.23</td>\n",
       "      <td>0.053</td>\n",
       "      <td>22.309</td>\n",
       "      <td>18.346</td>\n",
       "      <td>20.174</td>\n",
       "      <td>124.809</td>\n",
       "      <td>131.29</td>\n",
       "      <td>NaN</td>\n",
       "      <td>3.559</td>\n",
       "      <td>2.773</td>\n",
       "      <td>13.252</td>\n",
       "      <td>17.026</td>\n",
       "      <td>NaN</td>\n",
       "      <td>NaN</td>\n",
       "      <td>36.933</td>\n",
       "      <td>469.79</td>\n",
       "      <td>467.62</td>\n",
       "      <td>2.17</td>\n",
       "      <td>NaN</td>\n",
       "      <td>2.532</td>\n",
       "      <td>NaN</td>\n",
       "      <td>101.669</td>\n",
       "      <td>1692.57</td>\n",
       "      <td>0.425</td>\n",
       "      <td>64.5</td>\n",
       "      <td>38928346.0</td>\n",
       "      <td>60.0</td>\n",
       "      <td>18.0</td>\n",
       "      <td>25.0</td>\n",
       "      <td>NaN</td>\n",
       "      <td>NaN</td>\n",
       "      <td>0.5</td>\n",
       "      <td>NaN</td>\n",
       "      <td>1.05</td>\n",
       "      <td>1.03</td>\n",
       "      <td>1.03</td>\n",
       "      <td>1.03</td>\n",
       "      <td>0.97</td>\n",
       "      <td>0.85</td>\n",
       "      <td>1.03</td>\n",
       "      <td>37.62</td>\n",
       "      <td>36.31</td>\n",
       "      <td>39.33</td>\n",
       "      <td>77</td>\n",
       "      <td>23</td>\n",
       "      <td>0</td>\n",
       "      <td>-9.223372e+18</td>\n",
       "      <td>-1.317625e+18</td>\n",
       "      <td>2.142857</td>\n",
       "      <td>0.857143</td>\n",
       "      <td>-9.223372e+18</td>\n",
       "      <td>-1.317625e+18</td>\n",
       "      <td>0.0</td>\n",
       "      <td>0.0</td>\n",
       "      <td>31</td>\n",
       "      <td>12</td>\n",
       "      <td>1</td>\n",
       "      <td>4</td>\n",
       "      <td>1</td>\n",
       "      <td>1</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>65</th>\n",
       "      <td>NaN</td>\n",
       "      <td>nan</td>\n",
       "      <td>Afghanistan</td>\n",
       "      <td>33.0</td>\n",
       "      <td>65.0</td>\n",
       "      <td>2020-03-27</td>\n",
       "      <td>NaN</td>\n",
       "      <td>NaN</td>\n",
       "      <td>16.0</td>\n",
       "      <td>Afghanistan</td>\n",
       "      <td>87</td>\n",
       "      <td>-9.223372e+18</td>\n",
       "      <td>-9.223372e+18</td>\n",
       "      <td>20.475517</td>\n",
       "      <td>Afghanistan</td>\n",
       "      <td>528.154</td>\n",
       "      <td>1692.57</td>\n",
       "      <td>320.469</td>\n",
       "      <td>14300.19</td>\n",
       "      <td>45827.64</td>\n",
       "      <td>NaN</td>\n",
       "      <td>75.87</td>\n",
       "      <td>2054.23</td>\n",
       "      <td>0.053</td>\n",
       "      <td>22.309</td>\n",
       "      <td>18.346</td>\n",
       "      <td>20.174</td>\n",
       "      <td>124.809</td>\n",
       "      <td>131.29</td>\n",
       "      <td>NaN</td>\n",
       "      <td>3.559</td>\n",
       "      <td>2.773</td>\n",
       "      <td>13.252</td>\n",
       "      <td>17.026</td>\n",
       "      <td>NaN</td>\n",
       "      <td>NaN</td>\n",
       "      <td>36.933</td>\n",
       "      <td>469.79</td>\n",
       "      <td>467.62</td>\n",
       "      <td>2.17</td>\n",
       "      <td>NaN</td>\n",
       "      <td>2.532</td>\n",
       "      <td>NaN</td>\n",
       "      <td>101.669</td>\n",
       "      <td>1692.57</td>\n",
       "      <td>0.425</td>\n",
       "      <td>64.5</td>\n",
       "      <td>38928346.0</td>\n",
       "      <td>60.0</td>\n",
       "      <td>18.0</td>\n",
       "      <td>25.0</td>\n",
       "      <td>NaN</td>\n",
       "      <td>NaN</td>\n",
       "      <td>0.5</td>\n",
       "      <td>NaN</td>\n",
       "      <td>1.05</td>\n",
       "      <td>1.03</td>\n",
       "      <td>1.03</td>\n",
       "      <td>1.03</td>\n",
       "      <td>0.97</td>\n",
       "      <td>0.85</td>\n",
       "      <td>1.03</td>\n",
       "      <td>37.62</td>\n",
       "      <td>36.31</td>\n",
       "      <td>39.33</td>\n",
       "      <td>78</td>\n",
       "      <td>23</td>\n",
       "      <td>0</td>\n",
       "      <td>-9.223372e+18</td>\n",
       "      <td>-2.635249e+18</td>\n",
       "      <td>2.142857</td>\n",
       "      <td>0.857143</td>\n",
       "      <td>-9.223372e+18</td>\n",
       "      <td>-2.635249e+18</td>\n",
       "      <td>0.0</td>\n",
       "      <td>0.0</td>\n",
       "      <td>32</td>\n",
       "      <td>13</td>\n",
       "      <td>2</td>\n",
       "      <td>5</td>\n",
       "      <td>2</td>\n",
       "      <td>2</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>66</th>\n",
       "      <td>NaN</td>\n",
       "      <td>nan</td>\n",
       "      <td>Afghanistan</td>\n",
       "      <td>33.0</td>\n",
       "      <td>65.0</td>\n",
       "      <td>2020-03-28</td>\n",
       "      <td>NaN</td>\n",
       "      <td>NaN</td>\n",
       "      <td>17.0</td>\n",
       "      <td>Afghanistan</td>\n",
       "      <td>88</td>\n",
       "      <td>-9.223372e+18</td>\n",
       "      <td>-9.223372e+18</td>\n",
       "      <td>20.475517</td>\n",
       "      <td>Afghanistan</td>\n",
       "      <td>528.154</td>\n",
       "      <td>1692.57</td>\n",
       "      <td>320.469</td>\n",
       "      <td>14300.19</td>\n",
       "      <td>45827.64</td>\n",
       "      <td>NaN</td>\n",
       "      <td>75.87</td>\n",
       "      <td>2054.23</td>\n",
       "      <td>0.053</td>\n",
       "      <td>22.309</td>\n",
       "      <td>18.346</td>\n",
       "      <td>20.174</td>\n",
       "      <td>124.809</td>\n",
       "      <td>131.29</td>\n",
       "      <td>NaN</td>\n",
       "      <td>3.559</td>\n",
       "      <td>2.773</td>\n",
       "      <td>13.252</td>\n",
       "      <td>17.026</td>\n",
       "      <td>NaN</td>\n",
       "      <td>NaN</td>\n",
       "      <td>36.933</td>\n",
       "      <td>469.79</td>\n",
       "      <td>467.62</td>\n",
       "      <td>2.17</td>\n",
       "      <td>NaN</td>\n",
       "      <td>2.532</td>\n",
       "      <td>NaN</td>\n",
       "      <td>101.669</td>\n",
       "      <td>1692.57</td>\n",
       "      <td>0.425</td>\n",
       "      <td>64.5</td>\n",
       "      <td>38928346.0</td>\n",
       "      <td>60.0</td>\n",
       "      <td>18.0</td>\n",
       "      <td>25.0</td>\n",
       "      <td>NaN</td>\n",
       "      <td>NaN</td>\n",
       "      <td>0.5</td>\n",
       "      <td>NaN</td>\n",
       "      <td>1.05</td>\n",
       "      <td>1.03</td>\n",
       "      <td>1.03</td>\n",
       "      <td>1.03</td>\n",
       "      <td>0.97</td>\n",
       "      <td>0.85</td>\n",
       "      <td>1.03</td>\n",
       "      <td>37.62</td>\n",
       "      <td>36.31</td>\n",
       "      <td>39.33</td>\n",
       "      <td>79</td>\n",
       "      <td>23</td>\n",
       "      <td>0</td>\n",
       "      <td>-9.223372e+18</td>\n",
       "      <td>-3.952874e+18</td>\n",
       "      <td>2.428571</td>\n",
       "      <td>0.857143</td>\n",
       "      <td>-9.223372e+18</td>\n",
       "      <td>-3.952874e+18</td>\n",
       "      <td>0.0</td>\n",
       "      <td>0.0</td>\n",
       "      <td>33</td>\n",
       "      <td>14</td>\n",
       "      <td>3</td>\n",
       "      <td>6</td>\n",
       "      <td>3</td>\n",
       "      <td>3</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>67</th>\n",
       "      <td>NaN</td>\n",
       "      <td>nan</td>\n",
       "      <td>Afghanistan</td>\n",
       "      <td>33.0</td>\n",
       "      <td>65.0</td>\n",
       "      <td>2020-03-29</td>\n",
       "      <td>NaN</td>\n",
       "      <td>NaN</td>\n",
       "      <td>18.0</td>\n",
       "      <td>Afghanistan</td>\n",
       "      <td>89</td>\n",
       "      <td>-9.223372e+18</td>\n",
       "      <td>-9.223372e+18</td>\n",
       "      <td>20.475517</td>\n",
       "      <td>Afghanistan</td>\n",
       "      <td>528.154</td>\n",
       "      <td>1692.57</td>\n",
       "      <td>320.469</td>\n",
       "      <td>14300.19</td>\n",
       "      <td>45827.64</td>\n",
       "      <td>NaN</td>\n",
       "      <td>75.87</td>\n",
       "      <td>2054.23</td>\n",
       "      <td>0.053</td>\n",
       "      <td>22.309</td>\n",
       "      <td>18.346</td>\n",
       "      <td>20.174</td>\n",
       "      <td>124.809</td>\n",
       "      <td>131.29</td>\n",
       "      <td>NaN</td>\n",
       "      <td>3.559</td>\n",
       "      <td>2.773</td>\n",
       "      <td>13.252</td>\n",
       "      <td>17.026</td>\n",
       "      <td>NaN</td>\n",
       "      <td>NaN</td>\n",
       "      <td>36.933</td>\n",
       "      <td>469.79</td>\n",
       "      <td>467.62</td>\n",
       "      <td>2.17</td>\n",
       "      <td>NaN</td>\n",
       "      <td>2.532</td>\n",
       "      <td>NaN</td>\n",
       "      <td>101.669</td>\n",
       "      <td>1692.57</td>\n",
       "      <td>0.425</td>\n",
       "      <td>64.5</td>\n",
       "      <td>38928346.0</td>\n",
       "      <td>60.0</td>\n",
       "      <td>18.0</td>\n",
       "      <td>25.0</td>\n",
       "      <td>NaN</td>\n",
       "      <td>NaN</td>\n",
       "      <td>0.5</td>\n",
       "      <td>NaN</td>\n",
       "      <td>1.05</td>\n",
       "      <td>1.03</td>\n",
       "      <td>1.03</td>\n",
       "      <td>1.03</td>\n",
       "      <td>0.97</td>\n",
       "      <td>0.85</td>\n",
       "      <td>1.03</td>\n",
       "      <td>37.62</td>\n",
       "      <td>36.31</td>\n",
       "      <td>39.33</td>\n",
       "      <td>80</td>\n",
       "      <td>23</td>\n",
       "      <td>0</td>\n",
       "      <td>-9.223372e+18</td>\n",
       "      <td>-5.270498e+18</td>\n",
       "      <td>1.857143</td>\n",
       "      <td>1.428571</td>\n",
       "      <td>-9.223372e+18</td>\n",
       "      <td>-5.270498e+18</td>\n",
       "      <td>0.0</td>\n",
       "      <td>0.0</td>\n",
       "      <td>34</td>\n",
       "      <td>15</td>\n",
       "      <td>4</td>\n",
       "      <td>7</td>\n",
       "      <td>4</td>\n",
       "      <td>4</td>\n",
       "    </tr>\n",
       "  </tbody>\n",
       "</table>\n",
       "</div>"
      ],
      "text/plain": [
       "      Id Province/State Country/Region   Lat  Long       Date  ConfirmedCases  \\\n",
       "58  59.0            nan    Afghanistan  33.0  65.0 2020-03-20            24.0   \n",
       "59  60.0            nan    Afghanistan  33.0  65.0 2020-03-21            24.0   \n",
       "60  61.0            nan    Afghanistan  33.0  65.0 2020-03-22            40.0   \n",
       "61  62.0            nan    Afghanistan  33.0  65.0 2020-03-23            40.0   \n",
       "62  63.0            nan    Afghanistan  33.0  65.0 2020-03-24            74.0   \n",
       "63   NaN            nan    Afghanistan  33.0  65.0 2020-03-25             NaN   \n",
       "64   NaN            nan    Afghanistan  33.0  65.0 2020-03-26             NaN   \n",
       "65   NaN            nan    Afghanistan  33.0  65.0 2020-03-27             NaN   \n",
       "66   NaN            nan    Afghanistan  33.0  65.0 2020-03-28             NaN   \n",
       "67   NaN            nan    Afghanistan  33.0  65.0 2020-03-29             NaN   \n",
       "\n",
       "    Fatalities  ForecastId     place_id  day     cases/day     fatal/day  \\\n",
       "58         0.0         NaN  Afghanistan   80  2.000000e+00  0.000000e+00   \n",
       "59         0.0         NaN  Afghanistan   81  0.000000e+00  0.000000e+00   \n",
       "60         1.0         NaN  Afghanistan   82  1.600000e+01  1.000000e+00   \n",
       "61         1.0         NaN  Afghanistan   83  0.000000e+00  0.000000e+00   \n",
       "62         1.0         NaN  Afghanistan   84  3.400000e+01  0.000000e+00   \n",
       "63         NaN        14.0  Afghanistan   85 -9.223372e+18 -9.223372e+18   \n",
       "64         NaN        15.0  Afghanistan   86 -9.223372e+18 -9.223372e+18   \n",
       "65         NaN        16.0  Afghanistan   87 -9.223372e+18 -9.223372e+18   \n",
       "66         NaN        17.0  Afghanistan   88 -9.223372e+18 -9.223372e+18   \n",
       "67         NaN        18.0  Afghanistan   89 -9.223372e+18 -9.223372e+18   \n",
       "\n",
       "    SmokingRate      Country  Gross_domestic_product__constant_prices  \\\n",
       "58    20.475517  Afghanistan                                  528.154   \n",
       "59    20.475517  Afghanistan                                  528.154   \n",
       "60    20.475517  Afghanistan                                  528.154   \n",
       "61    20.475517  Afghanistan                                  528.154   \n",
       "62    20.475517  Afghanistan                                  528.154   \n",
       "63    20.475517  Afghanistan                                  528.154   \n",
       "64    20.475517  Afghanistan                                  528.154   \n",
       "65    20.475517  Afghanistan                                  528.154   \n",
       "66    20.475517  Afghanistan                                  528.154   \n",
       "67    20.475517  Afghanistan                                  528.154   \n",
       "\n",
       "    Gross_domestic_product__current_prices  Gross_domestic_product__deflator  \\\n",
       "58                                 1692.57                           320.469   \n",
       "59                                 1692.57                           320.469   \n",
       "60                                 1692.57                           320.469   \n",
       "61                                 1692.57                           320.469   \n",
       "62                                 1692.57                           320.469   \n",
       "63                                 1692.57                           320.469   \n",
       "64                                 1692.57                           320.469   \n",
       "65                                 1692.57                           320.469   \n",
       "66                                 1692.57                           320.469   \n",
       "67                                 1692.57                           320.469   \n",
       "\n",
       "    Gross_domestic_product_per_capita__constant_prices  \\\n",
       "58                                           14300.19    \n",
       "59                                           14300.19    \n",
       "60                                           14300.19    \n",
       "61                                           14300.19    \n",
       "62                                           14300.19    \n",
       "63                                           14300.19    \n",
       "64                                           14300.19    \n",
       "65                                           14300.19    \n",
       "66                                           14300.19    \n",
       "67                                           14300.19    \n",
       "\n",
       "    Gross_domestic_product_per_capita__current_prices  \\\n",
       "58                                           45827.64   \n",
       "59                                           45827.64   \n",
       "60                                           45827.64   \n",
       "61                                           45827.64   \n",
       "62                                           45827.64   \n",
       "63                                           45827.64   \n",
       "64                                           45827.64   \n",
       "65                                           45827.64   \n",
       "66                                           45827.64   \n",
       "67                                           45827.64   \n",
       "\n",
       "    Output_gap_in_percent_of_potential_GDP  \\\n",
       "58                                     NaN   \n",
       "59                                     NaN   \n",
       "60                                     NaN   \n",
       "61                                     NaN   \n",
       "62                                     NaN   \n",
       "63                                     NaN   \n",
       "64                                     NaN   \n",
       "65                                     NaN   \n",
       "66                                     NaN   \n",
       "67                                     NaN   \n",
       "\n",
       "    Gross_domestic_product_based_on_purchasing_power_parity__PPP__valuation_of_country_GDP  \\\n",
       "58                                              75.87                                        \n",
       "59                                              75.87                                        \n",
       "60                                              75.87                                        \n",
       "61                                              75.87                                        \n",
       "62                                              75.87                                        \n",
       "63                                              75.87                                        \n",
       "64                                              75.87                                        \n",
       "65                                              75.87                                        \n",
       "66                                              75.87                                        \n",
       "67                                              75.87                                        \n",
       "\n",
       "    Gross_domestic_product_based_on_purchasing_power_parity__PPP__per_capita_GDP  \\\n",
       "58                                            2054.23                              \n",
       "59                                            2054.23                              \n",
       "60                                            2054.23                              \n",
       "61                                            2054.23                              \n",
       "62                                            2054.23                              \n",
       "63                                            2054.23                              \n",
       "64                                            2054.23                              \n",
       "65                                            2054.23                              \n",
       "66                                            2054.23                              \n",
       "67                                            2054.23                              \n",
       "\n",
       "    Gross_domestic_product_based_on_purchasing_power_parity__PPP__share_of_world_total  \\\n",
       "58                                              0.053                                    \n",
       "59                                              0.053                                    \n",
       "60                                              0.053                                    \n",
       "61                                              0.053                                    \n",
       "62                                              0.053                                    \n",
       "63                                              0.053                                    \n",
       "64                                              0.053                                    \n",
       "65                                              0.053                                    \n",
       "66                                              0.053                                    \n",
       "67                                              0.053                                    \n",
       "\n",
       "    Implied_PPP_conversion_rate  Total_investment  Gross_national_savings  \\\n",
       "58                       22.309            18.346                  20.174   \n",
       "59                       22.309            18.346                  20.174   \n",
       "60                       22.309            18.346                  20.174   \n",
       "61                       22.309            18.346                  20.174   \n",
       "62                       22.309            18.346                  20.174   \n",
       "63                       22.309            18.346                  20.174   \n",
       "64                       22.309            18.346                  20.174   \n",
       "65                       22.309            18.346                  20.174   \n",
       "66                       22.309            18.346                  20.174   \n",
       "67                       22.309            18.346                  20.174   \n",
       "\n",
       "    Inflation__average_consumer_prices  \\\n",
       "58                             124.809   \n",
       "59                             124.809   \n",
       "60                             124.809   \n",
       "61                             124.809   \n",
       "62                             124.809   \n",
       "63                             124.809   \n",
       "64                             124.809   \n",
       "65                             124.809   \n",
       "66                             124.809   \n",
       "67                             124.809   \n",
       "\n",
       "    Inflation__end_of_period_consumer_prices  \\\n",
       "58                                    131.29   \n",
       "59                                    131.29   \n",
       "60                                    131.29   \n",
       "61                                    131.29   \n",
       "62                                    131.29   \n",
       "63                                    131.29   \n",
       "64                                    131.29   \n",
       "65                                    131.29   \n",
       "66                                    131.29   \n",
       "67                                    131.29   \n",
       "\n",
       "    Six_month_London_interbank_offered_rate__LIBOR_  \\\n",
       "58                                              NaN   \n",
       "59                                              NaN   \n",
       "60                                              NaN   \n",
       "61                                              NaN   \n",
       "62                                              NaN   \n",
       "63                                              NaN   \n",
       "64                                              NaN   \n",
       "65                                              NaN   \n",
       "66                                              NaN   \n",
       "67                                              NaN   \n",
       "\n",
       "    Volume_of_imports_of_goods_and_services  Volume_of_Imports_of_goods  \\\n",
       "58                                    3.559                       2.773   \n",
       "59                                    3.559                       2.773   \n",
       "60                                    3.559                       2.773   \n",
       "61                                    3.559                       2.773   \n",
       "62                                    3.559                       2.773   \n",
       "63                                    3.559                       2.773   \n",
       "64                                    3.559                       2.773   \n",
       "65                                    3.559                       2.773   \n",
       "66                                    3.559                       2.773   \n",
       "67                                    3.559                       2.773   \n",
       "\n",
       "    Volume_of_exports_of_goods_and_services  Volume_of_exports_of_goods  \\\n",
       "58                                   13.252                      17.026   \n",
       "59                                   13.252                      17.026   \n",
       "60                                   13.252                      17.026   \n",
       "61                                   13.252                      17.026   \n",
       "62                                   13.252                      17.026   \n",
       "63                                   13.252                      17.026   \n",
       "64                                   13.252                      17.026   \n",
       "65                                   13.252                      17.026   \n",
       "66                                   13.252                      17.026   \n",
       "67                                   13.252                      17.026   \n",
       "\n",
       "    Unemployment_rate  Employment  Population  General_government_revenue  \\\n",
       "58                NaN         NaN      36.933                      469.79   \n",
       "59                NaN         NaN      36.933                      469.79   \n",
       "60                NaN         NaN      36.933                      469.79   \n",
       "61                NaN         NaN      36.933                      469.79   \n",
       "62                NaN         NaN      36.933                      469.79   \n",
       "63                NaN         NaN      36.933                      469.79   \n",
       "64                NaN         NaN      36.933                      469.79   \n",
       "65                NaN         NaN      36.933                      469.79   \n",
       "66                NaN         NaN      36.933                      469.79   \n",
       "67                NaN         NaN      36.933                      469.79   \n",
       "\n",
       "    General_government_total_expenditure  \\\n",
       "58                                467.62   \n",
       "59                                467.62   \n",
       "60                                467.62   \n",
       "61                                467.62   \n",
       "62                                467.62   \n",
       "63                                467.62   \n",
       "64                                467.62   \n",
       "65                                467.62   \n",
       "66                                467.62   \n",
       "67                                467.62   \n",
       "\n",
       "    General_government_net_lending_borrowing  \\\n",
       "58                                      2.17   \n",
       "59                                      2.17   \n",
       "60                                      2.17   \n",
       "61                                      2.17   \n",
       "62                                      2.17   \n",
       "63                                      2.17   \n",
       "64                                      2.17   \n",
       "65                                      2.17   \n",
       "66                                      2.17   \n",
       "67                                      2.17   \n",
       "\n",
       "    General_government_structural_balance  \\\n",
       "58                                    NaN   \n",
       "59                                    NaN   \n",
       "60                                    NaN   \n",
       "61                                    NaN   \n",
       "62                                    NaN   \n",
       "63                                    NaN   \n",
       "64                                    NaN   \n",
       "65                                    NaN   \n",
       "66                                    NaN   \n",
       "67                                    NaN   \n",
       "\n",
       "    General_government_primary_net_lending_borrowing  \\\n",
       "58                                             2.532   \n",
       "59                                             2.532   \n",
       "60                                             2.532   \n",
       "61                                             2.532   \n",
       "62                                             2.532   \n",
       "63                                             2.532   \n",
       "64                                             2.532   \n",
       "65                                             2.532   \n",
       "66                                             2.532   \n",
       "67                                             2.532   \n",
       "\n",
       "    General_government_net_debt  General_government_gross_debt  \\\n",
       "58                          NaN                        101.669   \n",
       "59                          NaN                        101.669   \n",
       "60                          NaN                        101.669   \n",
       "61                          NaN                        101.669   \n",
       "62                          NaN                        101.669   \n",
       "63                          NaN                        101.669   \n",
       "64                          NaN                        101.669   \n",
       "65                          NaN                        101.669   \n",
       "66                          NaN                        101.669   \n",
       "67                          NaN                        101.669   \n",
       "\n",
       "    Gross_domestic_product_corresponding_to_fiscal_year__current_prices  \\\n",
       "58                                            1692.57                     \n",
       "59                                            1692.57                     \n",
       "60                                            1692.57                     \n",
       "61                                            1692.57                     \n",
       "62                                            1692.57                     \n",
       "63                                            1692.57                     \n",
       "64                                            1692.57                     \n",
       "65                                            1692.57                     \n",
       "66                                            1692.57                     \n",
       "67                                            1692.57                     \n",
       "\n",
       "    Current_account_balance  LifeExpectancy         pop  density  medianage  \\\n",
       "58                    0.425            64.5  38928346.0     60.0       18.0   \n",
       "59                    0.425            64.5  38928346.0     60.0       18.0   \n",
       "60                    0.425            64.5  38928346.0     60.0       18.0   \n",
       "61                    0.425            64.5  38928346.0     60.0       18.0   \n",
       "62                    0.425            64.5  38928346.0     60.0       18.0   \n",
       "63                    0.425            64.5  38928346.0     60.0       18.0   \n",
       "64                    0.425            64.5  38928346.0     60.0       18.0   \n",
       "65                    0.425            64.5  38928346.0     60.0       18.0   \n",
       "66                    0.425            64.5  38928346.0     60.0       18.0   \n",
       "67                    0.425            64.5  38928346.0     60.0       18.0   \n",
       "\n",
       "    urbanpop quarantine schools  hospibed  smokers  sex0  sex14  sex25  sex54  \\\n",
       "58      25.0        NaN     NaN       0.5      NaN  1.05   1.03   1.03   1.03   \n",
       "59      25.0        NaN     NaN       0.5      NaN  1.05   1.03   1.03   1.03   \n",
       "60      25.0        NaN     NaN       0.5      NaN  1.05   1.03   1.03   1.03   \n",
       "61      25.0        NaN     NaN       0.5      NaN  1.05   1.03   1.03   1.03   \n",
       "62      25.0        NaN     NaN       0.5      NaN  1.05   1.03   1.03   1.03   \n",
       "63      25.0        NaN     NaN       0.5      NaN  1.05   1.03   1.03   1.03   \n",
       "64      25.0        NaN     NaN       0.5      NaN  1.05   1.03   1.03   1.03   \n",
       "65      25.0        NaN     NaN       0.5      NaN  1.05   1.03   1.03   1.03   \n",
       "66      25.0        NaN     NaN       0.5      NaN  1.05   1.03   1.03   1.03   \n",
       "67      25.0        NaN     NaN       0.5      NaN  1.05   1.03   1.03   1.03   \n",
       "\n",
       "    sex64  sex65plus  sexratio   lung  femalelung  malelung  id  \\\n",
       "58   0.97       0.85      1.03  37.62       36.31     39.33  58   \n",
       "59   0.97       0.85      1.03  37.62       36.31     39.33  59   \n",
       "60   0.97       0.85      1.03  37.62       36.31     39.33  60   \n",
       "61   0.97       0.85      1.03  37.62       36.31     39.33  61   \n",
       "62   0.97       0.85      1.03  37.62       36.31     39.33  62   \n",
       "63   0.97       0.85      1.03  37.62       36.31     39.33  76   \n",
       "64   0.97       0.85      1.03  37.62       36.31     39.33  77   \n",
       "65   0.97       0.85      1.03  37.62       36.31     39.33  78   \n",
       "66   0.97       0.85      1.03  37.62       36.31     39.33  79   \n",
       "67   0.97       0.85      1.03  37.62       36.31     39.33  80   \n",
       "\n",
       "    Country/Region_le  Province/State_le  cases/day-(1-1)  cases/day-(1-7)  \\\n",
       "58                 23                  0     0.000000e+00     2.142857e+00   \n",
       "59                 23                  0     2.000000e+00     2.428571e+00   \n",
       "60                 23                  0     0.000000e+00     1.857143e+00   \n",
       "61                 23                  0     1.600000e+01     3.428571e+00   \n",
       "62                 23                  0     0.000000e+00     2.714286e+00   \n",
       "63                 23                  0     3.400000e+01     7.428571e+00   \n",
       "64                 23                  0    -9.223372e+18    -1.317625e+18   \n",
       "65                 23                  0    -9.223372e+18    -2.635249e+18   \n",
       "66                 23                  0    -9.223372e+18    -3.952874e+18   \n",
       "67                 23                  0    -9.223372e+18    -5.270498e+18   \n",
       "\n",
       "    cases/day-(8-14)  cases/day-(15-21)  fatal/day-(1-1)  fatal/day-(1-7)  \\\n",
       "58          0.857143           0.000000     0.000000e+00     0.000000e+00   \n",
       "59          0.857143           0.000000     0.000000e+00     0.000000e+00   \n",
       "60          1.428571           0.000000     0.000000e+00     0.000000e+00   \n",
       "61          1.714286           0.428571     1.000000e+00     1.428571e-01   \n",
       "62          2.428571           0.428571     0.000000e+00     1.428571e-01   \n",
       "63          2.428571           0.571429     0.000000e+00     1.428571e-01   \n",
       "64          2.142857           0.857143    -9.223372e+18    -1.317625e+18   \n",
       "65          2.142857           0.857143    -9.223372e+18    -2.635249e+18   \n",
       "66          2.428571           0.857143    -9.223372e+18    -3.952874e+18   \n",
       "67          1.857143           1.428571    -9.223372e+18    -5.270498e+18   \n",
       "\n",
       "    fatal/day-(8-14)  fatal/day-(15-21)  days_since_1cases  \\\n",
       "58               0.0                0.0                 25   \n",
       "59               0.0                0.0                 26   \n",
       "60               0.0                0.0                 27   \n",
       "61               0.0                0.0                 28   \n",
       "62               0.0                0.0                 29   \n",
       "63               0.0                0.0                 30   \n",
       "64               0.0                0.0                 31   \n",
       "65               0.0                0.0                 32   \n",
       "66               0.0                0.0                 33   \n",
       "67               0.0                0.0                 34   \n",
       "\n",
       "    days_since_10cases  days_since_100cases  days_since_1fatal  \\\n",
       "58                   6                    0                  0   \n",
       "59                   7                    0                  0   \n",
       "60                   8                    0                  0   \n",
       "61                   9                    0                  1   \n",
       "62                  10                    0                  2   \n",
       "63                  11                    0                  3   \n",
       "64                  12                    1                  4   \n",
       "65                  13                    2                  5   \n",
       "66                  14                    3                  6   \n",
       "67                  15                    4                  7   \n",
       "\n",
       "    days_since_10fatal  days_since_100fatal  \n",
       "58                   0                    0  \n",
       "59                   0                    0  \n",
       "60                   0                    0  \n",
       "61                   0                    0  \n",
       "62                   0                    0  \n",
       "63                   0                    0  \n",
       "64                   1                    1  \n",
       "65                   2                    2  \n",
       "66                   3                    3  \n",
       "67                   4                    4  "
      ]
     },
     "execution_count": 203,
     "metadata": {},
     "output_type": "execute_result"
    }
   ],
   "source": [
    "last_day_train = df_traintest8['day'][pd.isna(df_traintest8['ForecastId'])].max()\n",
    "print(last_day_train)\n",
    "df_tmp = df_traintest8[\n",
    "    (pd.isna(df_traintest8['ForecastId'])) |\n",
    "    ((df_traintest8['day']>last_day_train) & (pd.isna(df_traintest8['ForecastId'])==False))].reset_index(drop=True)\n",
    "df_tmp = df_tmp.drop([\n",
    "    'cases/day-(1-1)', 'cases/day-(1-7)', 'cases/day-(8-14)', 'cases/day-(15-21)', \n",
    "    'fatal/day-(1-1)', 'fatal/day-(1-7)', 'fatal/day-(8-14)', 'fatal/day-(15-21)',\n",
    "    'days_since_1cases', 'days_since_10cases', 'days_since_100cases',\n",
    "    'days_since_1fatal', 'days_since_10fatal', 'days_since_100fatal',\n",
    "                               ],  axis=1)\n",
    "df_traintest10 = []\n",
    "############################再次聚合，记不记得，我们又动了数据了\n",
    "for i, place in enumerate(places[:]):\n",
    "    df_tmp2 = df_tmp[df_tmp['place_id']==place].reset_index(drop=True)\n",
    "    df_tmp2 = do_aggregations(df_tmp2)\n",
    "    df_traintest10.append(df_tmp2)\n",
    "df_traintest10 = pd.concat(df_traintest10).reset_index(drop=True)\n",
    "df_traintest10[df_traintest10['day']>last_day_train-5].head(10) "
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 167,
   "metadata": {},
   "outputs": [],
   "source": [
    "###################和前面一样啊，只是预测的是死亡人数"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 210,
   "metadata": {},
   "outputs": [
    {
     "name": "stderr",
     "output_type": "stream",
     "text": [
      "F:\\Anaconda\\lib\\site-packages\\ipykernel_launcher.py:9: SettingWithCopyWarning: \n",
      "A value is trying to be set on a copy of a slice from a DataFrame\n",
      "\n",
      "See the caveats in the documentation: https://pandas.pydata.org/pandas-docs/stable/user_guide/indexing.html#returning-a-view-versus-a-copy\n",
      "  if __name__ == '__main__':\n",
      "F:\\Anaconda\\lib\\site-packages\\ipykernel_launcher.py:10: SettingWithCopyWarning: \n",
      "A value is trying to be set on a copy of a slice from a DataFrame\n",
      "\n",
      "See the caveats in the documentation: https://pandas.pydata.org/pandas-docs/stable/user_guide/indexing.html#returning-a-view-versus-a-copy\n",
      "  # Remove the CWD from sys.path while we load stuff.\n",
      "F:\\Anaconda\\lib\\site-packages\\ipykernel_launcher.py:18: SettingWithCopyWarning: \n",
      "A value is trying to be set on a copy of a slice from a DataFrame\n",
      "\n",
      "See the caveats in the documentation: https://pandas.pydata.org/pandas-docs/stable/user_guide/indexing.html#returning-a-view-versus-a-copy\n",
      "F:\\Anaconda\\lib\\site-packages\\ipykernel_launcher.py:19: SettingWithCopyWarning: \n",
      "A value is trying to be set on a copy of a slice from a DataFrame\n",
      "\n",
      "See the caveats in the documentation: https://pandas.pydata.org/pandas-docs/stable/user_guide/indexing.html#returning-a-view-versus-a-copy\n",
      "F:\\Anaconda\\lib\\site-packages\\lightgbm\\basic.py:497: UserWarning: Converting data to scipy sparse matrix.\n",
      "  warnings.warn('Converting data to scipy sparse matrix.')\n",
      "F:\\Anaconda\\lib\\site-packages\\ipykernel_launcher.py:29: SettingWithCopyWarning: \n",
      "A value is trying to be set on a copy of a slice from a DataFrame\n",
      "\n",
      "See the caveats in the documentation: https://pandas.pydata.org/pandas-docs/stable/user_guide/indexing.html#returning-a-view-versus-a-copy\n",
      "F:\\Anaconda\\lib\\site-packages\\ipykernel_launcher.py:30: SettingWithCopyWarning: \n",
      "A value is trying to be set on a copy of a slice from a DataFrame\n",
      "\n",
      "See the caveats in the documentation: https://pandas.pydata.org/pandas-docs/stable/user_guide/indexing.html#returning-a-view-versus-a-copy\n",
      "F:\\Anaconda\\lib\\site-packages\\ipykernel_launcher.py:31: SettingWithCopyWarning: \n",
      "A value is trying to be set on a copy of a slice from a DataFrame\n",
      "\n",
      "See the caveats in the documentation: https://pandas.pydata.org/pandas-docs/stable/user_guide/indexing.html#returning-a-view-versus-a-copy\n",
      "F:\\Anaconda\\lib\\site-packages\\ipykernel_launcher.py:32: SettingWithCopyWarning: \n",
      "A value is trying to be set on a copy of a slice from a DataFrame\n",
      "\n",
      "See the caveats in the documentation: https://pandas.pydata.org/pandas-docs/stable/user_guide/indexing.html#returning-a-view-versus-a-copy\n",
      "F:\\Anaconda\\lib\\site-packages\\ipykernel_launcher.py:6: SettingWithCopyWarning: \n",
      "A value is trying to be set on a copy of a slice from a DataFrame\n",
      "\n",
      "See the caveats in the documentation: https://pandas.pydata.org/pandas-docs/stable/user_guide/indexing.html#returning-a-view-versus-a-copy\n",
      "  \n",
      "F:\\Anaconda\\lib\\site-packages\\ipykernel_launcher.py:7: SettingWithCopyWarning: \n",
      "A value is trying to be set on a copy of a slice from a DataFrame\n",
      "\n",
      "See the caveats in the documentation: https://pandas.pydata.org/pandas-docs/stable/user_guide/indexing.html#returning-a-view-versus-a-copy\n",
      "  import sys\n"
     ]
    },
    {
     "name": "stdout",
     "output_type": "stream",
     "text": [
      "len train: 50, len prediction: 43\n",
      "63 [   0.    0.    0.    0.    0.    0.    0.    0.    0.    0.    0.    0.\n",
      "    0.    0.    0.    0.    0.    0.    0.    0.    0.    0.    0.    0.\n",
      "    0.    0.    0.    0.    2.    2.    4.    5.    8.   12.   16.   19.\n",
      "   26.   34.   43.   54.   66.   77.   92.  107.  124.  145.  194.  237.\n",
      "  291.  354.  429.  514.  611.  724.  853.  988. 1135. 1284. 1433. 1556.\n",
      " 1685. 1812. 1934.]\n",
      "Iran\n"
     ]
    },
    {
     "data": {
      "image/png": "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\n",
      "text/plain": [
       "<Figure size 432x288 with 1 Axes>"
      ]
     },
     "metadata": {
      "needs_background": "light"
     },
     "output_type": "display_data"
    }
   ],
   "source": [
    "place = places[np.random.randint(len(places))]\n",
    "place = \"Iran\"\n",
    "df_interest_base = df_traintest9[df_traintest9['place_id']==place].reset_index(drop=True)\n",
    "df_interest = copy.deepcopy(df_interest_base)\n",
    "df_interest['ConfirmedCases'] = df_interest['ConfirmedCases'].astype(np.float)\n",
    "df_interest['cases/day'] = df_interest['cases/day'].astype(np.float)\n",
    "df_interest['fatal/day'] = df_interest['fatal/day'].astype(np.float)\n",
    "df_interest['Fatalities'] = df_interest['Fatalities'].astype(np.float)\n",
    "df_interest['cases/day'][df_interest['day']>=72] = -1\n",
    "df_interest['fatal/day'][df_interest['day']>=72] = -1\n",
    "len_known = (df_interest['cases/day']!=-1).sum()\n",
    "len_unknown = (df_interest['cases/day']==-1).sum()\n",
    "print(\"len train: {}, len prediction: {}\".format(len_known, len_unknown))\n",
    "X_valid = df_interest[col_var][df_interest['day']>=72]\n",
    "X_valid2 = df_interest[col_var2][df_interest['day']>=72]\n",
    "pred_f =  np.exp(model.predict(X_valid))-1\n",
    "pred_c = np.exp(model2.predict(X_valid2))-1\n",
    "df_interest['fatal/day'][df_interest['day']>=72] = pred_f.clip(0, 1e10)\n",
    "df_interest['cases/day'][df_interest['day']>=72] = pred_c.clip(0, 1e10)\n",
    "df_interest['Fatalities'] = np.cumsum(df_interest['fatal/day'].values)\n",
    "df_interest['ConfirmedCases'] = np.cumsum(df_interest['cases/day'].values)\n",
    "for j in range(len_unknown): # use predicted cases and fatal for next days' prediction\n",
    "    X_valid = df_interest[col_var].iloc[j+len_known]\n",
    "    X_valid2 = df_interest[col_var2].iloc[j+len_known]\n",
    "    pred_f = model.predict(X_valid)\n",
    "    pred_c = model2.predict(X_valid2)\n",
    "    pred_c = (np.exp(pred_c)-1).clip(0, 1e10)\n",
    "    pred_f = (np.exp(pred_f)-1).clip(0, 1e10)\n",
    "    df_interest['fatal/day'][j+len_known] = pred_f\n",
    "    df_interest['cases/day'][j+len_known] = pred_c\n",
    "    df_interest['Fatalities'][j+len_known] = df_interest['Fatalities'][j+len_known-1] + pred_f\n",
    "    df_interest['ConfirmedCases'][j+len_known] = df_interest['ConfirmedCases'][j+len_known-1] + pred_c\n",
    "    df_interest = df_interest.drop([\n",
    "    'cases/day-(1-1)', 'cases/day-(1-7)', 'cases/day-(8-14)', 'cases/day-(15-21)', \n",
    "    'fatal/day-(1-1)', 'fatal/day-(1-7)', 'fatal/day-(8-14)', 'fatal/day-(15-21)',\n",
    "    'days_since_1cases', 'days_since_10cases', 'days_since_100cases',\n",
    "    'days_since_1fatal', 'days_since_10fatal', 'days_since_100fatal',\n",
    "                                   \n",
    "                                   ],  axis=1)\n",
    "    df_interest = do_aggregations(df_interest.reset_index(drop=True))\n",
    "\n",
    "# visualize\n",
    "tmp = df_interest['fatal/day'].values\n",
    "tmp = np.cumsum(tmp)\n",
    "sns.lineplot(x=df_interest_base['day'], y=tmp, label='pred')\n",
    "tmp = df_traintest8['Fatalities'][(df_traintest8['place_id']==place)& (pd.isna(df_traintest8['ForecastId']))].values\n",
    "print(len(tmp), tmp)\n",
    "sns.lineplot(x=df_traintest8['day'][(df_traintest8['place_id']==place)& (pd.isna(df_traintest8['ForecastId']))].values,\n",
    "             y=tmp, label='true')\n",
    "print(place)\n",
    "plt.show()"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 215,
   "metadata": {},
   "outputs": [
    {
     "data": {
      "text/plain": [
       "['final_case.pkl']"
      ]
     },
     "execution_count": 215,
     "metadata": {},
     "output_type": "execute_result"
    }
   ],
   "source": [
    "#####################来看看我们最终的模型\n",
    "###################这是最重要的模型\n",
    "###################调用过程\n",
    "joblib.dump(model,\"fatal.pkl\")\n",
    "joblib.dump(model2,\"case.pkl\")\n",
    "joblib.dump(model_pri,\"final_fatal.pkl\")\n",
    "joblib.dump(model2_pri,\"final_case.pkl\")"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 216,
   "metadata": {},
   "outputs": [],
   "source": [
    "model=joblib.load(\"fatal.pkl\")\n",
    "model2=joblib.load(\"case.pkl\")\n",
    "model_pri=joblib.load(\"final_fatal.pkl\")\n",
    "model2_pri=joblib.load(\"final_case.pkl\")"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 217,
   "metadata": {},
   "outputs": [
    {
     "name": "stderr",
     "output_type": "stream",
     "text": [
      "F:\\Anaconda\\lib\\site-packages\\ipykernel_launcher.py:8: SettingWithCopyWarning: \n",
      "A value is trying to be set on a copy of a slice from a DataFrame\n",
      "\n",
      "See the caveats in the documentation: https://pandas.pydata.org/pandas-docs/stable/user_guide/indexing.html#returning-a-view-versus-a-copy\n",
      "  \n",
      "F:\\Anaconda\\lib\\site-packages\\ipykernel_launcher.py:9: SettingWithCopyWarning: \n",
      "A value is trying to be set on a copy of a slice from a DataFrame\n",
      "\n",
      "See the caveats in the documentation: https://pandas.pydata.org/pandas-docs/stable/user_guide/indexing.html#returning-a-view-versus-a-copy\n",
      "  if __name__ == '__main__':\n",
      "F:\\Anaconda\\lib\\site-packages\\ipykernel_launcher.py:17: SettingWithCopyWarning: \n",
      "A value is trying to be set on a copy of a slice from a DataFrame\n",
      "\n",
      "See the caveats in the documentation: https://pandas.pydata.org/pandas-docs/stable/user_guide/indexing.html#returning-a-view-versus-a-copy\n",
      "F:\\Anaconda\\lib\\site-packages\\ipykernel_launcher.py:18: SettingWithCopyWarning: \n",
      "A value is trying to be set on a copy of a slice from a DataFrame\n",
      "\n",
      "See the caveats in the documentation: https://pandas.pydata.org/pandas-docs/stable/user_guide/indexing.html#returning-a-view-versus-a-copy\n",
      "F:\\Anaconda\\lib\\site-packages\\lightgbm\\basic.py:497: UserWarning: Converting data to scipy sparse matrix.\n",
      "  warnings.warn('Converting data to scipy sparse matrix.')\n",
      "F:\\Anaconda\\lib\\site-packages\\ipykernel_launcher.py:28: SettingWithCopyWarning: \n",
      "A value is trying to be set on a copy of a slice from a DataFrame\n",
      "\n",
      "See the caveats in the documentation: https://pandas.pydata.org/pandas-docs/stable/user_guide/indexing.html#returning-a-view-versus-a-copy\n",
      "F:\\Anaconda\\lib\\site-packages\\ipykernel_launcher.py:29: SettingWithCopyWarning: \n",
      "A value is trying to be set on a copy of a slice from a DataFrame\n",
      "\n",
      "See the caveats in the documentation: https://pandas.pydata.org/pandas-docs/stable/user_guide/indexing.html#returning-a-view-versus-a-copy\n",
      "F:\\Anaconda\\lib\\site-packages\\ipykernel_launcher.py:30: SettingWithCopyWarning: \n",
      "A value is trying to be set on a copy of a slice from a DataFrame\n",
      "\n",
      "See the caveats in the documentation: https://pandas.pydata.org/pandas-docs/stable/user_guide/indexing.html#returning-a-view-versus-a-copy\n",
      "F:\\Anaconda\\lib\\site-packages\\ipykernel_launcher.py:31: SettingWithCopyWarning: \n",
      "A value is trying to be set on a copy of a slice from a DataFrame\n",
      "\n",
      "See the caveats in the documentation: https://pandas.pydata.org/pandas-docs/stable/user_guide/indexing.html#returning-a-view-versus-a-copy\n",
      "F:\\Anaconda\\lib\\site-packages\\ipykernel_launcher.py:6: SettingWithCopyWarning: \n",
      "A value is trying to be set on a copy of a slice from a DataFrame\n",
      "\n",
      "See the caveats in the documentation: https://pandas.pydata.org/pandas-docs/stable/user_guide/indexing.html#returning-a-view-versus-a-copy\n",
      "  \n",
      "F:\\Anaconda\\lib\\site-packages\\ipykernel_launcher.py:7: SettingWithCopyWarning: \n",
      "A value is trying to be set on a copy of a slice from a DataFrame\n",
      "\n",
      "See the caveats in the documentation: https://pandas.pydata.org/pandas-docs/stable/user_guide/indexing.html#returning-a-view-versus-a-copy\n",
      "  import sys\n"
     ]
    },
    {
     "name": "stdout",
     "output_type": "stream",
     "text": [
      "len train: 63, len prediction: 30\n",
      "63 [ 0.  0.  0.  0.  0.  0.  0.  0.  0.  0.  0.  0.  0.  0.  0.  0.  0.  0.\n",
      "  0.  0.  0.  0.  0.  0.  0.  0.  0.  0.  0.  0.  0.  0.  0.  1.  1.  1.\n",
      "  1.  1.  1.  1.  1.  1.  1.  1.  1.  1.  4.  4.  5.  7.  7.  7. 11. 16.\n",
      " 21. 22. 22. 22. 24. 24. 40. 40. 74.]\n",
      "Afghanistan\n"
     ]
    },
    {
     "data": {
      "image/png": "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\n",
      "text/plain": [
       "<Figure size 432x288 with 1 Axes>"
      ]
     },
     "metadata": {
      "needs_background": "light"
     },
     "output_type": "display_data"
    }
   ],
   "source": [
    "place = 'Afghanistan'\n",
    "df_interest_base = df_traintest10[df_traintest10['place_id']==place].reset_index(drop=True)\n",
    "df_interest = copy.deepcopy(df_interest_base)\n",
    "df_interest['ConfirmedCases'] = df_interest['ConfirmedCases'].astype(np.float)\n",
    "df_interest['cases/day'] = df_interest['cases/day'].astype(np.float)\n",
    "df_interest['fatal/day'] = df_interest['fatal/day'].astype(np.float)\n",
    "df_interest['Fatalities'] = df_interest['Fatalities'].astype(np.float)\n",
    "df_interest['cases/day'][df_interest['day']>last_day_train] = -1\n",
    "df_interest['fatal/day'][df_interest['day']>last_day_train] = -1\n",
    "len_known = (df_interest['cases/day']!=-1).sum()\n",
    "len_unknown = (df_interest['cases/day']==-1).sum()\n",
    "print(\"len train: {}, len prediction: {}\".format(len_known, len_unknown))\n",
    "X_valid = df_interest[col_var][df_interest['day']>84]\n",
    "X_valid2 = df_interest[col_var2][df_interest['day']>84]\n",
    "pred_f =  np.exp(model.predict(X_valid))-1\n",
    "pred_c = np.exp(model2.predict(X_valid2))-1\n",
    "df_interest['fatal/day'][df_interest['day']>last_day_train] = pred_f.clip(0, 1e10)\n",
    "df_interest['cases/day'][df_interest['day']>last_day_train] = pred_c.clip(0, 1e10)\n",
    "df_interest['Fatalities'] = np.cumsum(df_interest['fatal/day'].values)\n",
    "df_interest['ConfirmedCases'] = np.cumsum(df_interest['cases/day'].values)\n",
    "for j in range(len_unknown): # use predicted cases and fatal for next days' prediction\n",
    "    X_valid = df_interest[col_var].iloc[j+len_known]\n",
    "    X_valid2 = df_interest[col_var2].iloc[j+len_known]\n",
    "    pred_f = model_pri.predict(X_valid)\n",
    "    pred_c = model2_pri.predict(X_valid2)\n",
    "    pred_c = (np.exp(pred_c)-1).clip(0, 1e10)\n",
    "    pred_f = (np.exp(pred_f)-1).clip(0, 1e10)\n",
    "    df_interest['fatal/day'][j+len_known] = pred_f\n",
    "    df_interest['cases/day'][j+len_known] = pred_c\n",
    "    df_interest['Fatalities'][j+len_known] = df_interest['Fatalities'][j+len_known-1] + pred_f\n",
    "    df_interest['ConfirmedCases'][j+len_known] = df_interest['ConfirmedCases'][j+len_known-1] + pred_c\n",
    "    df_interest = df_interest.drop([\n",
    "         'cases/day-(1-1)', 'cases/day-(1-7)', 'cases/day-(8-14)', 'cases/day-(15-21)', \n",
    "    'fatal/day-(1-1)', 'fatal/day-(1-7)', 'fatal/day-(8-14)', 'fatal/day-(15-21)',\n",
    "    'days_since_1cases', 'days_since_10cases', 'days_since_100cases',\n",
    "    'days_since_1fatal', 'days_since_10fatal', 'days_since_100fatal',],  axis=1)\n",
    "    df_interest = do_aggregations(df_interest.reset_index(drop=True))\n",
    "\n",
    "# visualize\n",
    "tmp = df_interest['cases/day'].values\n",
    "tmp = np.cumsum(tmp)\n",
    "sns.lineplot(x=df_interest_base['day'], y=tmp, label='pred')\n",
    "tmp = df_traintest10['ConfirmedCases'][(df_traintest10['place_id']==place)& (pd.isna(df_traintest10['ForecastId']))].values\n",
    "print(len(tmp), tmp)\n",
    "sns.lineplot(x=df_traintest10['day'][(df_traintest10['place_id']==place)& (pd.isna(df_traintest10['ForecastId']))].values,\n",
    "             y=tmp, label='true')\n",
    "print(place)\n",
    "plt.show()"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 213,
   "metadata": {},
   "outputs": [
    {
     "data": {
      "text/html": [
       "<div>\n",
       "<style scoped>\n",
       "    .dataframe tbody tr th:only-of-type {\n",
       "        vertical-align: middle;\n",
       "    }\n",
       "\n",
       "    .dataframe tbody tr th {\n",
       "        vertical-align: top;\n",
       "    }\n",
       "\n",
       "    .dataframe thead th {\n",
       "        text-align: right;\n",
       "    }\n",
       "</style>\n",
       "<table border=\"1\" class=\"dataframe\">\n",
       "  <thead>\n",
       "    <tr style=\"text-align: right;\">\n",
       "      <th></th>\n",
       "      <th>Id</th>\n",
       "      <th>Province/State</th>\n",
       "      <th>Country/Region</th>\n",
       "      <th>Lat</th>\n",
       "      <th>Long</th>\n",
       "      <th>Date</th>\n",
       "      <th>ConfirmedCases</th>\n",
       "      <th>Fatalities</th>\n",
       "      <th>ForecastId</th>\n",
       "      <th>place_id</th>\n",
       "      <th>day</th>\n",
       "      <th>cases/day</th>\n",
       "      <th>fatal/day</th>\n",
       "      <th>SmokingRate</th>\n",
       "      <th>Country</th>\n",
       "      <th>Gross_domestic_product__constant_prices</th>\n",
       "      <th>Gross_domestic_product__current_prices</th>\n",
       "      <th>Gross_domestic_product__deflator</th>\n",
       "      <th>Gross_domestic_product_per_capita__constant_prices</th>\n",
       "      <th>Gross_domestic_product_per_capita__current_prices</th>\n",
       "      <th>Output_gap_in_percent_of_potential_GDP</th>\n",
       "      <th>Gross_domestic_product_based_on_purchasing_power_parity__PPP__valuation_of_country_GDP</th>\n",
       "      <th>Gross_domestic_product_based_on_purchasing_power_parity__PPP__per_capita_GDP</th>\n",
       "      <th>Gross_domestic_product_based_on_purchasing_power_parity__PPP__share_of_world_total</th>\n",
       "      <th>Implied_PPP_conversion_rate</th>\n",
       "      <th>Total_investment</th>\n",
       "      <th>Gross_national_savings</th>\n",
       "      <th>Inflation__average_consumer_prices</th>\n",
       "      <th>Inflation__end_of_period_consumer_prices</th>\n",
       "      <th>Six_month_London_interbank_offered_rate__LIBOR_</th>\n",
       "      <th>Volume_of_imports_of_goods_and_services</th>\n",
       "      <th>Volume_of_Imports_of_goods</th>\n",
       "      <th>Volume_of_exports_of_goods_and_services</th>\n",
       "      <th>Volume_of_exports_of_goods</th>\n",
       "      <th>Unemployment_rate</th>\n",
       "      <th>Employment</th>\n",
       "      <th>Population</th>\n",
       "      <th>General_government_revenue</th>\n",
       "      <th>General_government_total_expenditure</th>\n",
       "      <th>General_government_net_lending_borrowing</th>\n",
       "      <th>General_government_structural_balance</th>\n",
       "      <th>General_government_primary_net_lending_borrowing</th>\n",
       "      <th>General_government_net_debt</th>\n",
       "      <th>General_government_gross_debt</th>\n",
       "      <th>Gross_domestic_product_corresponding_to_fiscal_year__current_prices</th>\n",
       "      <th>Current_account_balance</th>\n",
       "      <th>LifeExpectancy</th>\n",
       "      <th>pop</th>\n",
       "      <th>density</th>\n",
       "      <th>medianage</th>\n",
       "      <th>urbanpop</th>\n",
       "      <th>quarantine</th>\n",
       "      <th>schools</th>\n",
       "      <th>hospibed</th>\n",
       "      <th>smokers</th>\n",
       "      <th>sex0</th>\n",
       "      <th>sex14</th>\n",
       "      <th>sex25</th>\n",
       "      <th>sex54</th>\n",
       "      <th>sex64</th>\n",
       "      <th>sex65plus</th>\n",
       "      <th>sexratio</th>\n",
       "      <th>lung</th>\n",
       "      <th>femalelung</th>\n",
       "      <th>malelung</th>\n",
       "      <th>id</th>\n",
       "      <th>Country/Region_le</th>\n",
       "      <th>Province/State_le</th>\n",
       "      <th>cases/day-(1-1)</th>\n",
       "      <th>cases/day-(1-7)</th>\n",
       "      <th>cases/day-(8-14)</th>\n",
       "      <th>cases/day-(15-21)</th>\n",
       "      <th>fatal/day-(1-1)</th>\n",
       "      <th>fatal/day-(1-7)</th>\n",
       "      <th>fatal/day-(8-14)</th>\n",
       "      <th>fatal/day-(15-21)</th>\n",
       "      <th>days_since_1cases</th>\n",
       "      <th>days_since_10cases</th>\n",
       "      <th>days_since_100cases</th>\n",
       "      <th>days_since_1fatal</th>\n",
       "      <th>days_since_10fatal</th>\n",
       "      <th>days_since_100fatal</th>\n",
       "    </tr>\n",
       "  </thead>\n",
       "  <tbody>\n",
       "    <tr>\n",
       "      <th>70</th>\n",
       "      <td>NaN</td>\n",
       "      <td>nan</td>\n",
       "      <td>Afghanistan</td>\n",
       "      <td>33.0</td>\n",
       "      <td>65.0</td>\n",
       "      <td>2020-04-01</td>\n",
       "      <td>158.896905</td>\n",
       "      <td>2.114806</td>\n",
       "      <td>21.0</td>\n",
       "      <td>Afghanistan</td>\n",
       "      <td>92</td>\n",
       "      <td>9.556067</td>\n",
       "      <td>0.133722</td>\n",
       "      <td>20.475517</td>\n",
       "      <td>Afghanistan</td>\n",
       "      <td>528.154</td>\n",
       "      <td>1692.57</td>\n",
       "      <td>320.469</td>\n",
       "      <td>14300.19</td>\n",
       "      <td>45827.64</td>\n",
       "      <td>NaN</td>\n",
       "      <td>75.87</td>\n",
       "      <td>2054.23</td>\n",
       "      <td>0.053</td>\n",
       "      <td>22.309</td>\n",
       "      <td>18.346</td>\n",
       "      <td>20.174</td>\n",
       "      <td>124.809</td>\n",
       "      <td>131.29</td>\n",
       "      <td>NaN</td>\n",
       "      <td>3.559</td>\n",
       "      <td>2.773</td>\n",
       "      <td>13.252</td>\n",
       "      <td>17.026</td>\n",
       "      <td>NaN</td>\n",
       "      <td>NaN</td>\n",
       "      <td>36.933</td>\n",
       "      <td>469.79</td>\n",
       "      <td>467.62</td>\n",
       "      <td>2.17</td>\n",
       "      <td>NaN</td>\n",
       "      <td>2.532</td>\n",
       "      <td>NaN</td>\n",
       "      <td>101.669</td>\n",
       "      <td>1692.57</td>\n",
       "      <td>0.425</td>\n",
       "      <td>64.5</td>\n",
       "      <td>38928346.0</td>\n",
       "      <td>60.0</td>\n",
       "      <td>18.0</td>\n",
       "      <td>25.0</td>\n",
       "      <td>NaN</td>\n",
       "      <td>NaN</td>\n",
       "      <td>0.5</td>\n",
       "      <td>NaN</td>\n",
       "      <td>1.05</td>\n",
       "      <td>1.03</td>\n",
       "      <td>1.03</td>\n",
       "      <td>1.03</td>\n",
       "      <td>0.97</td>\n",
       "      <td>0.85</td>\n",
       "      <td>1.03</td>\n",
       "      <td>37.62</td>\n",
       "      <td>36.31</td>\n",
       "      <td>39.33</td>\n",
       "      <td>83</td>\n",
       "      <td>23</td>\n",
       "      <td>0</td>\n",
       "      <td>14.612295</td>\n",
       "      <td>10.762977</td>\n",
       "      <td>7.428571</td>\n",
       "      <td>2.428571</td>\n",
       "      <td>0.141621</td>\n",
       "      <td>0.140155</td>\n",
       "      <td>0.142857</td>\n",
       "      <td>0.000000</td>\n",
       "      <td>37</td>\n",
       "      <td>18</td>\n",
       "      <td>5</td>\n",
       "      <td>10</td>\n",
       "      <td>0</td>\n",
       "      <td>0</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>71</th>\n",
       "      <td>NaN</td>\n",
       "      <td>nan</td>\n",
       "      <td>Afghanistan</td>\n",
       "      <td>33.0</td>\n",
       "      <td>65.0</td>\n",
       "      <td>2020-04-02</td>\n",
       "      <td>167.367179</td>\n",
       "      <td>2.245659</td>\n",
       "      <td>22.0</td>\n",
       "      <td>Afghanistan</td>\n",
       "      <td>93</td>\n",
       "      <td>8.470274</td>\n",
       "      <td>0.130852</td>\n",
       "      <td>20.475517</td>\n",
       "      <td>Afghanistan</td>\n",
       "      <td>528.154</td>\n",
       "      <td>1692.57</td>\n",
       "      <td>320.469</td>\n",
       "      <td>14300.19</td>\n",
       "      <td>45827.64</td>\n",
       "      <td>NaN</td>\n",
       "      <td>75.87</td>\n",
       "      <td>2054.23</td>\n",
       "      <td>0.053</td>\n",
       "      <td>22.309</td>\n",
       "      <td>18.346</td>\n",
       "      <td>20.174</td>\n",
       "      <td>124.809</td>\n",
       "      <td>131.29</td>\n",
       "      <td>NaN</td>\n",
       "      <td>3.559</td>\n",
       "      <td>2.773</td>\n",
       "      <td>13.252</td>\n",
       "      <td>17.026</td>\n",
       "      <td>NaN</td>\n",
       "      <td>NaN</td>\n",
       "      <td>36.933</td>\n",
       "      <td>469.79</td>\n",
       "      <td>467.62</td>\n",
       "      <td>2.17</td>\n",
       "      <td>NaN</td>\n",
       "      <td>2.532</td>\n",
       "      <td>NaN</td>\n",
       "      <td>101.669</td>\n",
       "      <td>1692.57</td>\n",
       "      <td>0.425</td>\n",
       "      <td>64.5</td>\n",
       "      <td>38928346.0</td>\n",
       "      <td>60.0</td>\n",
       "      <td>18.0</td>\n",
       "      <td>25.0</td>\n",
       "      <td>NaN</td>\n",
       "      <td>NaN</td>\n",
       "      <td>0.5</td>\n",
       "      <td>NaN</td>\n",
       "      <td>1.05</td>\n",
       "      <td>1.03</td>\n",
       "      <td>1.03</td>\n",
       "      <td>1.03</td>\n",
       "      <td>0.97</td>\n",
       "      <td>0.85</td>\n",
       "      <td>1.03</td>\n",
       "      <td>37.62</td>\n",
       "      <td>36.31</td>\n",
       "      <td>39.33</td>\n",
       "      <td>84</td>\n",
       "      <td>23</td>\n",
       "      <td>0</td>\n",
       "      <td>9.556067</td>\n",
       "      <td>10.885245</td>\n",
       "      <td>8.671456</td>\n",
       "      <td>2.142857</td>\n",
       "      <td>0.133722</td>\n",
       "      <td>0.133868</td>\n",
       "      <td>0.168247</td>\n",
       "      <td>0.000000</td>\n",
       "      <td>38</td>\n",
       "      <td>19</td>\n",
       "      <td>6</td>\n",
       "      <td>11</td>\n",
       "      <td>0</td>\n",
       "      <td>0</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>72</th>\n",
       "      <td>NaN</td>\n",
       "      <td>nan</td>\n",
       "      <td>Afghanistan</td>\n",
       "      <td>33.0</td>\n",
       "      <td>65.0</td>\n",
       "      <td>2020-04-03</td>\n",
       "      <td>176.027870</td>\n",
       "      <td>2.376511</td>\n",
       "      <td>23.0</td>\n",
       "      <td>Afghanistan</td>\n",
       "      <td>94</td>\n",
       "      <td>8.660692</td>\n",
       "      <td>0.130852</td>\n",
       "      <td>20.475517</td>\n",
       "      <td>Afghanistan</td>\n",
       "      <td>528.154</td>\n",
       "      <td>1692.57</td>\n",
       "      <td>320.469</td>\n",
       "      <td>14300.19</td>\n",
       "      <td>45827.64</td>\n",
       "      <td>NaN</td>\n",
       "      <td>75.87</td>\n",
       "      <td>2054.23</td>\n",
       "      <td>0.053</td>\n",
       "      <td>22.309</td>\n",
       "      <td>18.346</td>\n",
       "      <td>20.174</td>\n",
       "      <td>124.809</td>\n",
       "      <td>131.29</td>\n",
       "      <td>NaN</td>\n",
       "      <td>3.559</td>\n",
       "      <td>2.773</td>\n",
       "      <td>13.252</td>\n",
       "      <td>17.026</td>\n",
       "      <td>NaN</td>\n",
       "      <td>NaN</td>\n",
       "      <td>36.933</td>\n",
       "      <td>469.79</td>\n",
       "      <td>467.62</td>\n",
       "      <td>2.17</td>\n",
       "      <td>NaN</td>\n",
       "      <td>2.532</td>\n",
       "      <td>NaN</td>\n",
       "      <td>101.669</td>\n",
       "      <td>1692.57</td>\n",
       "      <td>0.425</td>\n",
       "      <td>64.5</td>\n",
       "      <td>38928346.0</td>\n",
       "      <td>60.0</td>\n",
       "      <td>18.0</td>\n",
       "      <td>25.0</td>\n",
       "      <td>NaN</td>\n",
       "      <td>NaN</td>\n",
       "      <td>0.5</td>\n",
       "      <td>NaN</td>\n",
       "      <td>1.05</td>\n",
       "      <td>1.03</td>\n",
       "      <td>1.03</td>\n",
       "      <td>1.03</td>\n",
       "      <td>0.97</td>\n",
       "      <td>0.85</td>\n",
       "      <td>1.03</td>\n",
       "      <td>37.62</td>\n",
       "      <td>36.31</td>\n",
       "      <td>39.33</td>\n",
       "      <td>85</td>\n",
       "      <td>23</td>\n",
       "      <td>0</td>\n",
       "      <td>8.470274</td>\n",
       "      <td>10.872678</td>\n",
       "      <td>9.894062</td>\n",
       "      <td>2.142857</td>\n",
       "      <td>0.130852</td>\n",
       "      <td>0.135079</td>\n",
       "      <td>0.185729</td>\n",
       "      <td>0.000000</td>\n",
       "      <td>39</td>\n",
       "      <td>20</td>\n",
       "      <td>7</td>\n",
       "      <td>12</td>\n",
       "      <td>0</td>\n",
       "      <td>0</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>73</th>\n",
       "      <td>NaN</td>\n",
       "      <td>nan</td>\n",
       "      <td>Afghanistan</td>\n",
       "      <td>33.0</td>\n",
       "      <td>65.0</td>\n",
       "      <td>2020-04-04</td>\n",
       "      <td>184.824466</td>\n",
       "      <td>2.507363</td>\n",
       "      <td>24.0</td>\n",
       "      <td>Afghanistan</td>\n",
       "      <td>95</td>\n",
       "      <td>8.796596</td>\n",
       "      <td>0.130852</td>\n",
       "      <td>20.475517</td>\n",
       "      <td>Afghanistan</td>\n",
       "      <td>528.154</td>\n",
       "      <td>1692.57</td>\n",
       "      <td>320.469</td>\n",
       "      <td>14300.19</td>\n",
       "      <td>45827.64</td>\n",
       "      <td>NaN</td>\n",
       "      <td>75.87</td>\n",
       "      <td>2054.23</td>\n",
       "      <td>0.053</td>\n",
       "      <td>22.309</td>\n",
       "      <td>18.346</td>\n",
       "      <td>20.174</td>\n",
       "      <td>124.809</td>\n",
       "      <td>131.29</td>\n",
       "      <td>NaN</td>\n",
       "      <td>3.559</td>\n",
       "      <td>2.773</td>\n",
       "      <td>13.252</td>\n",
       "      <td>17.026</td>\n",
       "      <td>NaN</td>\n",
       "      <td>NaN</td>\n",
       "      <td>36.933</td>\n",
       "      <td>469.79</td>\n",
       "      <td>467.62</td>\n",
       "      <td>2.17</td>\n",
       "      <td>NaN</td>\n",
       "      <td>2.532</td>\n",
       "      <td>NaN</td>\n",
       "      <td>101.669</td>\n",
       "      <td>1692.57</td>\n",
       "      <td>0.425</td>\n",
       "      <td>64.5</td>\n",
       "      <td>38928346.0</td>\n",
       "      <td>60.0</td>\n",
       "      <td>18.0</td>\n",
       "      <td>25.0</td>\n",
       "      <td>NaN</td>\n",
       "      <td>NaN</td>\n",
       "      <td>0.5</td>\n",
       "      <td>NaN</td>\n",
       "      <td>1.05</td>\n",
       "      <td>1.03</td>\n",
       "      <td>1.03</td>\n",
       "      <td>1.03</td>\n",
       "      <td>0.97</td>\n",
       "      <td>0.85</td>\n",
       "      <td>1.03</td>\n",
       "      <td>37.62</td>\n",
       "      <td>36.31</td>\n",
       "      <td>39.33</td>\n",
       "      <td>86</td>\n",
       "      <td>23</td>\n",
       "      <td>0</td>\n",
       "      <td>8.660692</td>\n",
       "      <td>10.681087</td>\n",
       "      <td>11.037180</td>\n",
       "      <td>2.428571</td>\n",
       "      <td>0.130852</td>\n",
       "      <td>0.136290</td>\n",
       "      <td>0.203212</td>\n",
       "      <td>0.000000</td>\n",
       "      <td>40</td>\n",
       "      <td>21</td>\n",
       "      <td>8</td>\n",
       "      <td>13</td>\n",
       "      <td>0</td>\n",
       "      <td>0</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>74</th>\n",
       "      <td>NaN</td>\n",
       "      <td>nan</td>\n",
       "      <td>Afghanistan</td>\n",
       "      <td>33.0</td>\n",
       "      <td>65.0</td>\n",
       "      <td>2020-04-05</td>\n",
       "      <td>193.915763</td>\n",
       "      <td>2.648085</td>\n",
       "      <td>25.0</td>\n",
       "      <td>Afghanistan</td>\n",
       "      <td>96</td>\n",
       "      <td>9.091297</td>\n",
       "      <td>0.140722</td>\n",
       "      <td>20.475517</td>\n",
       "      <td>Afghanistan</td>\n",
       "      <td>528.154</td>\n",
       "      <td>1692.57</td>\n",
       "      <td>320.469</td>\n",
       "      <td>14300.19</td>\n",
       "      <td>45827.64</td>\n",
       "      <td>NaN</td>\n",
       "      <td>75.87</td>\n",
       "      <td>2054.23</td>\n",
       "      <td>0.053</td>\n",
       "      <td>22.309</td>\n",
       "      <td>18.346</td>\n",
       "      <td>20.174</td>\n",
       "      <td>124.809</td>\n",
       "      <td>131.29</td>\n",
       "      <td>NaN</td>\n",
       "      <td>3.559</td>\n",
       "      <td>2.773</td>\n",
       "      <td>13.252</td>\n",
       "      <td>17.026</td>\n",
       "      <td>NaN</td>\n",
       "      <td>NaN</td>\n",
       "      <td>36.933</td>\n",
       "      <td>469.79</td>\n",
       "      <td>467.62</td>\n",
       "      <td>2.17</td>\n",
       "      <td>NaN</td>\n",
       "      <td>2.532</td>\n",
       "      <td>NaN</td>\n",
       "      <td>101.669</td>\n",
       "      <td>1692.57</td>\n",
       "      <td>0.425</td>\n",
       "      <td>64.5</td>\n",
       "      <td>38928346.0</td>\n",
       "      <td>60.0</td>\n",
       "      <td>18.0</td>\n",
       "      <td>25.0</td>\n",
       "      <td>NaN</td>\n",
       "      <td>NaN</td>\n",
       "      <td>0.5</td>\n",
       "      <td>NaN</td>\n",
       "      <td>1.05</td>\n",
       "      <td>1.03</td>\n",
       "      <td>1.03</td>\n",
       "      <td>1.03</td>\n",
       "      <td>0.97</td>\n",
       "      <td>0.85</td>\n",
       "      <td>1.03</td>\n",
       "      <td>37.62</td>\n",
       "      <td>36.31</td>\n",
       "      <td>39.33</td>\n",
       "      <td>87</td>\n",
       "      <td>23</td>\n",
       "      <td>0</td>\n",
       "      <td>8.796596</td>\n",
       "      <td>10.485437</td>\n",
       "      <td>12.489486</td>\n",
       "      <td>1.857143</td>\n",
       "      <td>0.130852</td>\n",
       "      <td>0.137295</td>\n",
       "      <td>0.220900</td>\n",
       "      <td>0.000000</td>\n",
       "      <td>41</td>\n",
       "      <td>22</td>\n",
       "      <td>9</td>\n",
       "      <td>14</td>\n",
       "      <td>0</td>\n",
       "      <td>0</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>75</th>\n",
       "      <td>NaN</td>\n",
       "      <td>nan</td>\n",
       "      <td>Afghanistan</td>\n",
       "      <td>33.0</td>\n",
       "      <td>65.0</td>\n",
       "      <td>2020-04-06</td>\n",
       "      <td>202.280153</td>\n",
       "      <td>2.778938</td>\n",
       "      <td>26.0</td>\n",
       "      <td>Afghanistan</td>\n",
       "      <td>97</td>\n",
       "      <td>8.364390</td>\n",
       "      <td>0.130852</td>\n",
       "      <td>20.475517</td>\n",
       "      <td>Afghanistan</td>\n",
       "      <td>528.154</td>\n",
       "      <td>1692.57</td>\n",
       "      <td>320.469</td>\n",
       "      <td>14300.19</td>\n",
       "      <td>45827.64</td>\n",
       "      <td>NaN</td>\n",
       "      <td>75.87</td>\n",
       "      <td>2054.23</td>\n",
       "      <td>0.053</td>\n",
       "      <td>22.309</td>\n",
       "      <td>18.346</td>\n",
       "      <td>20.174</td>\n",
       "      <td>124.809</td>\n",
       "      <td>131.29</td>\n",
       "      <td>NaN</td>\n",
       "      <td>3.559</td>\n",
       "      <td>2.773</td>\n",
       "      <td>13.252</td>\n",
       "      <td>17.026</td>\n",
       "      <td>NaN</td>\n",
       "      <td>NaN</td>\n",
       "      <td>36.933</td>\n",
       "      <td>469.79</td>\n",
       "      <td>467.62</td>\n",
       "      <td>2.17</td>\n",
       "      <td>NaN</td>\n",
       "      <td>2.532</td>\n",
       "      <td>NaN</td>\n",
       "      <td>101.669</td>\n",
       "      <td>1692.57</td>\n",
       "      <td>0.425</td>\n",
       "      <td>64.5</td>\n",
       "      <td>38928346.0</td>\n",
       "      <td>60.0</td>\n",
       "      <td>18.0</td>\n",
       "      <td>25.0</td>\n",
       "      <td>NaN</td>\n",
       "      <td>NaN</td>\n",
       "      <td>0.5</td>\n",
       "      <td>NaN</td>\n",
       "      <td>1.05</td>\n",
       "      <td>1.03</td>\n",
       "      <td>1.03</td>\n",
       "      <td>1.03</td>\n",
       "      <td>0.97</td>\n",
       "      <td>0.85</td>\n",
       "      <td>1.03</td>\n",
       "      <td>37.62</td>\n",
       "      <td>36.31</td>\n",
       "      <td>39.33</td>\n",
       "      <td>88</td>\n",
       "      <td>23</td>\n",
       "      <td>0</td>\n",
       "      <td>9.091297</td>\n",
       "      <td>10.096811</td>\n",
       "      <td>11.891155</td>\n",
       "      <td>3.428571</td>\n",
       "      <td>0.140722</td>\n",
       "      <td>0.134621</td>\n",
       "      <td>0.100820</td>\n",
       "      <td>0.142857</td>\n",
       "      <td>42</td>\n",
       "      <td>23</td>\n",
       "      <td>10</td>\n",
       "      <td>15</td>\n",
       "      <td>0</td>\n",
       "      <td>0</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>76</th>\n",
       "      <td>NaN</td>\n",
       "      <td>nan</td>\n",
       "      <td>Afghanistan</td>\n",
       "      <td>33.0</td>\n",
       "      <td>65.0</td>\n",
       "      <td>2020-04-07</td>\n",
       "      <td>210.300575</td>\n",
       "      <td>2.908341</td>\n",
       "      <td>27.0</td>\n",
       "      <td>Afghanistan</td>\n",
       "      <td>98</td>\n",
       "      <td>8.020422</td>\n",
       "      <td>0.129404</td>\n",
       "      <td>20.475517</td>\n",
       "      <td>Afghanistan</td>\n",
       "      <td>528.154</td>\n",
       "      <td>1692.57</td>\n",
       "      <td>320.469</td>\n",
       "      <td>14300.19</td>\n",
       "      <td>45827.64</td>\n",
       "      <td>NaN</td>\n",
       "      <td>75.87</td>\n",
       "      <td>2054.23</td>\n",
       "      <td>0.053</td>\n",
       "      <td>22.309</td>\n",
       "      <td>18.346</td>\n",
       "      <td>20.174</td>\n",
       "      <td>124.809</td>\n",
       "      <td>131.29</td>\n",
       "      <td>NaN</td>\n",
       "      <td>3.559</td>\n",
       "      <td>2.773</td>\n",
       "      <td>13.252</td>\n",
       "      <td>17.026</td>\n",
       "      <td>NaN</td>\n",
       "      <td>NaN</td>\n",
       "      <td>36.933</td>\n",
       "      <td>469.79</td>\n",
       "      <td>467.62</td>\n",
       "      <td>2.17</td>\n",
       "      <td>NaN</td>\n",
       "      <td>2.532</td>\n",
       "      <td>NaN</td>\n",
       "      <td>101.669</td>\n",
       "      <td>1692.57</td>\n",
       "      <td>0.425</td>\n",
       "      <td>64.5</td>\n",
       "      <td>38928346.0</td>\n",
       "      <td>60.0</td>\n",
       "      <td>18.0</td>\n",
       "      <td>25.0</td>\n",
       "      <td>NaN</td>\n",
       "      <td>NaN</td>\n",
       "      <td>0.5</td>\n",
       "      <td>NaN</td>\n",
       "      <td>1.05</td>\n",
       "      <td>1.03</td>\n",
       "      <td>1.03</td>\n",
       "      <td>1.03</td>\n",
       "      <td>0.97</td>\n",
       "      <td>0.85</td>\n",
       "      <td>1.03</td>\n",
       "      <td>37.62</td>\n",
       "      <td>36.31</td>\n",
       "      <td>39.33</td>\n",
       "      <td>89</td>\n",
       "      <td>23</td>\n",
       "      <td>0</td>\n",
       "      <td>8.364390</td>\n",
       "      <td>9.650230</td>\n",
       "      <td>13.532649</td>\n",
       "      <td>2.714286</td>\n",
       "      <td>0.130852</td>\n",
       "      <td>0.134211</td>\n",
       "      <td>0.119923</td>\n",
       "      <td>0.142857</td>\n",
       "      <td>43</td>\n",
       "      <td>24</td>\n",
       "      <td>11</td>\n",
       "      <td>16</td>\n",
       "      <td>0</td>\n",
       "      <td>0</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>77</th>\n",
       "      <td>NaN</td>\n",
       "      <td>nan</td>\n",
       "      <td>Afghanistan</td>\n",
       "      <td>33.0</td>\n",
       "      <td>65.0</td>\n",
       "      <td>2020-04-08</td>\n",
       "      <td>215.430094</td>\n",
       "      <td>3.037745</td>\n",
       "      <td>28.0</td>\n",
       "      <td>Afghanistan</td>\n",
       "      <td>99</td>\n",
       "      <td>5.129519</td>\n",
       "      <td>0.129404</td>\n",
       "      <td>20.475517</td>\n",
       "      <td>Afghanistan</td>\n",
       "      <td>528.154</td>\n",
       "      <td>1692.57</td>\n",
       "      <td>320.469</td>\n",
       "      <td>14300.19</td>\n",
       "      <td>45827.64</td>\n",
       "      <td>NaN</td>\n",
       "      <td>75.87</td>\n",
       "      <td>2054.23</td>\n",
       "      <td>0.053</td>\n",
       "      <td>22.309</td>\n",
       "      <td>18.346</td>\n",
       "      <td>20.174</td>\n",
       "      <td>124.809</td>\n",
       "      <td>131.29</td>\n",
       "      <td>NaN</td>\n",
       "      <td>3.559</td>\n",
       "      <td>2.773</td>\n",
       "      <td>13.252</td>\n",
       "      <td>17.026</td>\n",
       "      <td>NaN</td>\n",
       "      <td>NaN</td>\n",
       "      <td>36.933</td>\n",
       "      <td>469.79</td>\n",
       "      <td>467.62</td>\n",
       "      <td>2.17</td>\n",
       "      <td>NaN</td>\n",
       "      <td>2.532</td>\n",
       "      <td>NaN</td>\n",
       "      <td>101.669</td>\n",
       "      <td>1692.57</td>\n",
       "      <td>0.425</td>\n",
       "      <td>64.5</td>\n",
       "      <td>38928346.0</td>\n",
       "      <td>60.0</td>\n",
       "      <td>18.0</td>\n",
       "      <td>25.0</td>\n",
       "      <td>NaN</td>\n",
       "      <td>NaN</td>\n",
       "      <td>0.5</td>\n",
       "      <td>NaN</td>\n",
       "      <td>1.05</td>\n",
       "      <td>1.03</td>\n",
       "      <td>1.03</td>\n",
       "      <td>1.03</td>\n",
       "      <td>0.97</td>\n",
       "      <td>0.85</td>\n",
       "      <td>1.03</td>\n",
       "      <td>37.62</td>\n",
       "      <td>36.31</td>\n",
       "      <td>39.33</td>\n",
       "      <td>90</td>\n",
       "      <td>23</td>\n",
       "      <td>0</td>\n",
       "      <td>8.020422</td>\n",
       "      <td>8.708534</td>\n",
       "      <td>10.762977</td>\n",
       "      <td>7.428571</td>\n",
       "      <td>0.129404</td>\n",
       "      <td>0.132465</td>\n",
       "      <td>0.140155</td>\n",
       "      <td>0.142857</td>\n",
       "      <td>44</td>\n",
       "      <td>25</td>\n",
       "      <td>12</td>\n",
       "      <td>17</td>\n",
       "      <td>0</td>\n",
       "      <td>0</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>78</th>\n",
       "      <td>NaN</td>\n",
       "      <td>nan</td>\n",
       "      <td>Afghanistan</td>\n",
       "      <td>33.0</td>\n",
       "      <td>65.0</td>\n",
       "      <td>2020-04-09</td>\n",
       "      <td>218.576738</td>\n",
       "      <td>3.159197</td>\n",
       "      <td>29.0</td>\n",
       "      <td>Afghanistan</td>\n",
       "      <td>100</td>\n",
       "      <td>3.146644</td>\n",
       "      <td>0.121452</td>\n",
       "      <td>20.475517</td>\n",
       "      <td>Afghanistan</td>\n",
       "      <td>528.154</td>\n",
       "      <td>1692.57</td>\n",
       "      <td>320.469</td>\n",
       "      <td>14300.19</td>\n",
       "      <td>45827.64</td>\n",
       "      <td>NaN</td>\n",
       "      <td>75.87</td>\n",
       "      <td>2054.23</td>\n",
       "      <td>0.053</td>\n",
       "      <td>22.309</td>\n",
       "      <td>18.346</td>\n",
       "      <td>20.174</td>\n",
       "      <td>124.809</td>\n",
       "      <td>131.29</td>\n",
       "      <td>NaN</td>\n",
       "      <td>3.559</td>\n",
       "      <td>2.773</td>\n",
       "      <td>13.252</td>\n",
       "      <td>17.026</td>\n",
       "      <td>NaN</td>\n",
       "      <td>NaN</td>\n",
       "      <td>36.933</td>\n",
       "      <td>469.79</td>\n",
       "      <td>467.62</td>\n",
       "      <td>2.17</td>\n",
       "      <td>NaN</td>\n",
       "      <td>2.532</td>\n",
       "      <td>NaN</td>\n",
       "      <td>101.669</td>\n",
       "      <td>1692.57</td>\n",
       "      <td>0.425</td>\n",
       "      <td>64.5</td>\n",
       "      <td>38928346.0</td>\n",
       "      <td>60.0</td>\n",
       "      <td>18.0</td>\n",
       "      <td>25.0</td>\n",
       "      <td>NaN</td>\n",
       "      <td>NaN</td>\n",
       "      <td>0.5</td>\n",
       "      <td>NaN</td>\n",
       "      <td>1.05</td>\n",
       "      <td>1.03</td>\n",
       "      <td>1.03</td>\n",
       "      <td>1.03</td>\n",
       "      <td>0.97</td>\n",
       "      <td>0.85</td>\n",
       "      <td>1.03</td>\n",
       "      <td>37.62</td>\n",
       "      <td>36.31</td>\n",
       "      <td>39.33</td>\n",
       "      <td>91</td>\n",
       "      <td>23</td>\n",
       "      <td>0</td>\n",
       "      <td>5.129519</td>\n",
       "      <td>8.076170</td>\n",
       "      <td>10.885245</td>\n",
       "      <td>8.671456</td>\n",
       "      <td>0.129404</td>\n",
       "      <td>0.131848</td>\n",
       "      <td>0.133868</td>\n",
       "      <td>0.168247</td>\n",
       "      <td>45</td>\n",
       "      <td>26</td>\n",
       "      <td>13</td>\n",
       "      <td>18</td>\n",
       "      <td>0</td>\n",
       "      <td>0</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>79</th>\n",
       "      <td>NaN</td>\n",
       "      <td>nan</td>\n",
       "      <td>Afghanistan</td>\n",
       "      <td>33.0</td>\n",
       "      <td>65.0</td>\n",
       "      <td>2020-04-10</td>\n",
       "      <td>221.396333</td>\n",
       "      <td>3.276091</td>\n",
       "      <td>30.0</td>\n",
       "      <td>Afghanistan</td>\n",
       "      <td>101</td>\n",
       "      <td>2.819595</td>\n",
       "      <td>0.116894</td>\n",
       "      <td>20.475517</td>\n",
       "      <td>Afghanistan</td>\n",
       "      <td>528.154</td>\n",
       "      <td>1692.57</td>\n",
       "      <td>320.469</td>\n",
       "      <td>14300.19</td>\n",
       "      <td>45827.64</td>\n",
       "      <td>NaN</td>\n",
       "      <td>75.87</td>\n",
       "      <td>2054.23</td>\n",
       "      <td>0.053</td>\n",
       "      <td>22.309</td>\n",
       "      <td>18.346</td>\n",
       "      <td>20.174</td>\n",
       "      <td>124.809</td>\n",
       "      <td>131.29</td>\n",
       "      <td>NaN</td>\n",
       "      <td>3.559</td>\n",
       "      <td>2.773</td>\n",
       "      <td>13.252</td>\n",
       "      <td>17.026</td>\n",
       "      <td>NaN</td>\n",
       "      <td>NaN</td>\n",
       "      <td>36.933</td>\n",
       "      <td>469.79</td>\n",
       "      <td>467.62</td>\n",
       "      <td>2.17</td>\n",
       "      <td>NaN</td>\n",
       "      <td>2.532</td>\n",
       "      <td>NaN</td>\n",
       "      <td>101.669</td>\n",
       "      <td>1692.57</td>\n",
       "      <td>0.425</td>\n",
       "      <td>64.5</td>\n",
       "      <td>38928346.0</td>\n",
       "      <td>60.0</td>\n",
       "      <td>18.0</td>\n",
       "      <td>25.0</td>\n",
       "      <td>NaN</td>\n",
       "      <td>NaN</td>\n",
       "      <td>0.5</td>\n",
       "      <td>NaN</td>\n",
       "      <td>1.05</td>\n",
       "      <td>1.03</td>\n",
       "      <td>1.03</td>\n",
       "      <td>1.03</td>\n",
       "      <td>0.97</td>\n",
       "      <td>0.85</td>\n",
       "      <td>1.03</td>\n",
       "      <td>37.62</td>\n",
       "      <td>36.31</td>\n",
       "      <td>39.33</td>\n",
       "      <td>92</td>\n",
       "      <td>23</td>\n",
       "      <td>0</td>\n",
       "      <td>3.146644</td>\n",
       "      <td>7.315651</td>\n",
       "      <td>10.872678</td>\n",
       "      <td>9.894062</td>\n",
       "      <td>0.121452</td>\n",
       "      <td>0.130505</td>\n",
       "      <td>0.135079</td>\n",
       "      <td>0.185729</td>\n",
       "      <td>46</td>\n",
       "      <td>27</td>\n",
       "      <td>14</td>\n",
       "      <td>19</td>\n",
       "      <td>0</td>\n",
       "      <td>0</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>80</th>\n",
       "      <td>NaN</td>\n",
       "      <td>nan</td>\n",
       "      <td>Afghanistan</td>\n",
       "      <td>33.0</td>\n",
       "      <td>65.0</td>\n",
       "      <td>2020-04-11</td>\n",
       "      <td>223.452238</td>\n",
       "      <td>3.388968</td>\n",
       "      <td>31.0</td>\n",
       "      <td>Afghanistan</td>\n",
       "      <td>102</td>\n",
       "      <td>2.055905</td>\n",
       "      <td>0.112877</td>\n",
       "      <td>20.475517</td>\n",
       "      <td>Afghanistan</td>\n",
       "      <td>528.154</td>\n",
       "      <td>1692.57</td>\n",
       "      <td>320.469</td>\n",
       "      <td>14300.19</td>\n",
       "      <td>45827.64</td>\n",
       "      <td>NaN</td>\n",
       "      <td>75.87</td>\n",
       "      <td>2054.23</td>\n",
       "      <td>0.053</td>\n",
       "      <td>22.309</td>\n",
       "      <td>18.346</td>\n",
       "      <td>20.174</td>\n",
       "      <td>124.809</td>\n",
       "      <td>131.29</td>\n",
       "      <td>NaN</td>\n",
       "      <td>3.559</td>\n",
       "      <td>2.773</td>\n",
       "      <td>13.252</td>\n",
       "      <td>17.026</td>\n",
       "      <td>NaN</td>\n",
       "      <td>NaN</td>\n",
       "      <td>36.933</td>\n",
       "      <td>469.79</td>\n",
       "      <td>467.62</td>\n",
       "      <td>2.17</td>\n",
       "      <td>NaN</td>\n",
       "      <td>2.532</td>\n",
       "      <td>NaN</td>\n",
       "      <td>101.669</td>\n",
       "      <td>1692.57</td>\n",
       "      <td>0.425</td>\n",
       "      <td>64.5</td>\n",
       "      <td>38928346.0</td>\n",
       "      <td>60.0</td>\n",
       "      <td>18.0</td>\n",
       "      <td>25.0</td>\n",
       "      <td>NaN</td>\n",
       "      <td>NaN</td>\n",
       "      <td>0.5</td>\n",
       "      <td>NaN</td>\n",
       "      <td>1.05</td>\n",
       "      <td>1.03</td>\n",
       "      <td>1.03</td>\n",
       "      <td>1.03</td>\n",
       "      <td>0.97</td>\n",
       "      <td>0.85</td>\n",
       "      <td>1.03</td>\n",
       "      <td>37.62</td>\n",
       "      <td>36.31</td>\n",
       "      <td>39.33</td>\n",
       "      <td>93</td>\n",
       "      <td>23</td>\n",
       "      <td>0</td>\n",
       "      <td>2.819595</td>\n",
       "      <td>6.481209</td>\n",
       "      <td>10.681087</td>\n",
       "      <td>11.037180</td>\n",
       "      <td>0.116894</td>\n",
       "      <td>0.128511</td>\n",
       "      <td>0.136290</td>\n",
       "      <td>0.203212</td>\n",
       "      <td>47</td>\n",
       "      <td>28</td>\n",
       "      <td>15</td>\n",
       "      <td>20</td>\n",
       "      <td>0</td>\n",
       "      <td>0</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>81</th>\n",
       "      <td>NaN</td>\n",
       "      <td>nan</td>\n",
       "      <td>Afghanistan</td>\n",
       "      <td>33.0</td>\n",
       "      <td>65.0</td>\n",
       "      <td>2020-04-12</td>\n",
       "      <td>225.153146</td>\n",
       "      <td>3.482994</td>\n",
       "      <td>32.0</td>\n",
       "      <td>Afghanistan</td>\n",
       "      <td>103</td>\n",
       "      <td>1.700908</td>\n",
       "      <td>0.094026</td>\n",
       "      <td>20.475517</td>\n",
       "      <td>Afghanistan</td>\n",
       "      <td>528.154</td>\n",
       "      <td>1692.57</td>\n",
       "      <td>320.469</td>\n",
       "      <td>14300.19</td>\n",
       "      <td>45827.64</td>\n",
       "      <td>NaN</td>\n",
       "      <td>75.87</td>\n",
       "      <td>2054.23</td>\n",
       "      <td>0.053</td>\n",
       "      <td>22.309</td>\n",
       "      <td>18.346</td>\n",
       "      <td>20.174</td>\n",
       "      <td>124.809</td>\n",
       "      <td>131.29</td>\n",
       "      <td>NaN</td>\n",
       "      <td>3.559</td>\n",
       "      <td>2.773</td>\n",
       "      <td>13.252</td>\n",
       "      <td>17.026</td>\n",
       "      <td>NaN</td>\n",
       "      <td>NaN</td>\n",
       "      <td>36.933</td>\n",
       "      <td>469.79</td>\n",
       "      <td>467.62</td>\n",
       "      <td>2.17</td>\n",
       "      <td>NaN</td>\n",
       "      <td>2.532</td>\n",
       "      <td>NaN</td>\n",
       "      <td>101.669</td>\n",
       "      <td>1692.57</td>\n",
       "      <td>0.425</td>\n",
       "      <td>64.5</td>\n",
       "      <td>38928346.0</td>\n",
       "      <td>60.0</td>\n",
       "      <td>18.0</td>\n",
       "      <td>25.0</td>\n",
       "      <td>NaN</td>\n",
       "      <td>NaN</td>\n",
       "      <td>0.5</td>\n",
       "      <td>NaN</td>\n",
       "      <td>1.05</td>\n",
       "      <td>1.03</td>\n",
       "      <td>1.03</td>\n",
       "      <td>1.03</td>\n",
       "      <td>0.97</td>\n",
       "      <td>0.85</td>\n",
       "      <td>1.03</td>\n",
       "      <td>37.62</td>\n",
       "      <td>36.31</td>\n",
       "      <td>39.33</td>\n",
       "      <td>94</td>\n",
       "      <td>23</td>\n",
       "      <td>0</td>\n",
       "      <td>2.055905</td>\n",
       "      <td>5.518253</td>\n",
       "      <td>10.485437</td>\n",
       "      <td>12.489486</td>\n",
       "      <td>0.112877</td>\n",
       "      <td>0.125943</td>\n",
       "      <td>0.137295</td>\n",
       "      <td>0.220900</td>\n",
       "      <td>48</td>\n",
       "      <td>29</td>\n",
       "      <td>16</td>\n",
       "      <td>21</td>\n",
       "      <td>0</td>\n",
       "      <td>0</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>82</th>\n",
       "      <td>NaN</td>\n",
       "      <td>nan</td>\n",
       "      <td>Afghanistan</td>\n",
       "      <td>33.0</td>\n",
       "      <td>65.0</td>\n",
       "      <td>2020-04-13</td>\n",
       "      <td>226.935755</td>\n",
       "      <td>3.569331</td>\n",
       "      <td>33.0</td>\n",
       "      <td>Afghanistan</td>\n",
       "      <td>104</td>\n",
       "      <td>1.782609</td>\n",
       "      <td>0.086337</td>\n",
       "      <td>20.475517</td>\n",
       "      <td>Afghanistan</td>\n",
       "      <td>528.154</td>\n",
       "      <td>1692.57</td>\n",
       "      <td>320.469</td>\n",
       "      <td>14300.19</td>\n",
       "      <td>45827.64</td>\n",
       "      <td>NaN</td>\n",
       "      <td>75.87</td>\n",
       "      <td>2054.23</td>\n",
       "      <td>0.053</td>\n",
       "      <td>22.309</td>\n",
       "      <td>18.346</td>\n",
       "      <td>20.174</td>\n",
       "      <td>124.809</td>\n",
       "      <td>131.29</td>\n",
       "      <td>NaN</td>\n",
       "      <td>3.559</td>\n",
       "      <td>2.773</td>\n",
       "      <td>13.252</td>\n",
       "      <td>17.026</td>\n",
       "      <td>NaN</td>\n",
       "      <td>NaN</td>\n",
       "      <td>36.933</td>\n",
       "      <td>469.79</td>\n",
       "      <td>467.62</td>\n",
       "      <td>2.17</td>\n",
       "      <td>NaN</td>\n",
       "      <td>2.532</td>\n",
       "      <td>NaN</td>\n",
       "      <td>101.669</td>\n",
       "      <td>1692.57</td>\n",
       "      <td>0.425</td>\n",
       "      <td>64.5</td>\n",
       "      <td>38928346.0</td>\n",
       "      <td>60.0</td>\n",
       "      <td>18.0</td>\n",
       "      <td>25.0</td>\n",
       "      <td>NaN</td>\n",
       "      <td>NaN</td>\n",
       "      <td>0.5</td>\n",
       "      <td>NaN</td>\n",
       "      <td>1.05</td>\n",
       "      <td>1.03</td>\n",
       "      <td>1.03</td>\n",
       "      <td>1.03</td>\n",
       "      <td>0.97</td>\n",
       "      <td>0.85</td>\n",
       "      <td>1.03</td>\n",
       "      <td>37.62</td>\n",
       "      <td>36.31</td>\n",
       "      <td>39.33</td>\n",
       "      <td>95</td>\n",
       "      <td>23</td>\n",
       "      <td>0</td>\n",
       "      <td>1.700908</td>\n",
       "      <td>4.462483</td>\n",
       "      <td>10.096811</td>\n",
       "      <td>11.891155</td>\n",
       "      <td>0.094026</td>\n",
       "      <td>0.119273</td>\n",
       "      <td>0.134621</td>\n",
       "      <td>0.100820</td>\n",
       "      <td>49</td>\n",
       "      <td>30</td>\n",
       "      <td>17</td>\n",
       "      <td>22</td>\n",
       "      <td>0</td>\n",
       "      <td>0</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>83</th>\n",
       "      <td>NaN</td>\n",
       "      <td>nan</td>\n",
       "      <td>Afghanistan</td>\n",
       "      <td>33.0</td>\n",
       "      <td>65.0</td>\n",
       "      <td>2020-04-14</td>\n",
       "      <td>228.133626</td>\n",
       "      <td>3.653395</td>\n",
       "      <td>34.0</td>\n",
       "      <td>Afghanistan</td>\n",
       "      <td>105</td>\n",
       "      <td>1.197871</td>\n",
       "      <td>0.084063</td>\n",
       "      <td>20.475517</td>\n",
       "      <td>Afghanistan</td>\n",
       "      <td>528.154</td>\n",
       "      <td>1692.57</td>\n",
       "      <td>320.469</td>\n",
       "      <td>14300.19</td>\n",
       "      <td>45827.64</td>\n",
       "      <td>NaN</td>\n",
       "      <td>75.87</td>\n",
       "      <td>2054.23</td>\n",
       "      <td>0.053</td>\n",
       "      <td>22.309</td>\n",
       "      <td>18.346</td>\n",
       "      <td>20.174</td>\n",
       "      <td>124.809</td>\n",
       "      <td>131.29</td>\n",
       "      <td>NaN</td>\n",
       "      <td>3.559</td>\n",
       "      <td>2.773</td>\n",
       "      <td>13.252</td>\n",
       "      <td>17.026</td>\n",
       "      <td>NaN</td>\n",
       "      <td>NaN</td>\n",
       "      <td>36.933</td>\n",
       "      <td>469.79</td>\n",
       "      <td>467.62</td>\n",
       "      <td>2.17</td>\n",
       "      <td>NaN</td>\n",
       "      <td>2.532</td>\n",
       "      <td>NaN</td>\n",
       "      <td>101.669</td>\n",
       "      <td>1692.57</td>\n",
       "      <td>0.425</td>\n",
       "      <td>64.5</td>\n",
       "      <td>38928346.0</td>\n",
       "      <td>60.0</td>\n",
       "      <td>18.0</td>\n",
       "      <td>25.0</td>\n",
       "      <td>NaN</td>\n",
       "      <td>NaN</td>\n",
       "      <td>0.5</td>\n",
       "      <td>NaN</td>\n",
       "      <td>1.05</td>\n",
       "      <td>1.03</td>\n",
       "      <td>1.03</td>\n",
       "      <td>1.03</td>\n",
       "      <td>0.97</td>\n",
       "      <td>0.85</td>\n",
       "      <td>1.03</td>\n",
       "      <td>37.62</td>\n",
       "      <td>36.31</td>\n",
       "      <td>39.33</td>\n",
       "      <td>96</td>\n",
       "      <td>23</td>\n",
       "      <td>0</td>\n",
       "      <td>1.782609</td>\n",
       "      <td>3.522229</td>\n",
       "      <td>9.650230</td>\n",
       "      <td>13.532649</td>\n",
       "      <td>0.086337</td>\n",
       "      <td>0.112913</td>\n",
       "      <td>0.134211</td>\n",
       "      <td>0.119923</td>\n",
       "      <td>50</td>\n",
       "      <td>31</td>\n",
       "      <td>18</td>\n",
       "      <td>23</td>\n",
       "      <td>0</td>\n",
       "      <td>0</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>84</th>\n",
       "      <td>NaN</td>\n",
       "      <td>nan</td>\n",
       "      <td>Afghanistan</td>\n",
       "      <td>33.0</td>\n",
       "      <td>65.0</td>\n",
       "      <td>2020-04-15</td>\n",
       "      <td>229.069275</td>\n",
       "      <td>3.736910</td>\n",
       "      <td>35.0</td>\n",
       "      <td>Afghanistan</td>\n",
       "      <td>106</td>\n",
       "      <td>0.935649</td>\n",
       "      <td>0.083516</td>\n",
       "      <td>20.475517</td>\n",
       "      <td>Afghanistan</td>\n",
       "      <td>528.154</td>\n",
       "      <td>1692.57</td>\n",
       "      <td>320.469</td>\n",
       "      <td>14300.19</td>\n",
       "      <td>45827.64</td>\n",
       "      <td>NaN</td>\n",
       "      <td>75.87</td>\n",
       "      <td>2054.23</td>\n",
       "      <td>0.053</td>\n",
       "      <td>22.309</td>\n",
       "      <td>18.346</td>\n",
       "      <td>20.174</td>\n",
       "      <td>124.809</td>\n",
       "      <td>131.29</td>\n",
       "      <td>NaN</td>\n",
       "      <td>3.559</td>\n",
       "      <td>2.773</td>\n",
       "      <td>13.252</td>\n",
       "      <td>17.026</td>\n",
       "      <td>NaN</td>\n",
       "      <td>NaN</td>\n",
       "      <td>36.933</td>\n",
       "      <td>469.79</td>\n",
       "      <td>467.62</td>\n",
       "      <td>2.17</td>\n",
       "      <td>NaN</td>\n",
       "      <td>2.532</td>\n",
       "      <td>NaN</td>\n",
       "      <td>101.669</td>\n",
       "      <td>1692.57</td>\n",
       "      <td>0.425</td>\n",
       "      <td>64.5</td>\n",
       "      <td>38928346.0</td>\n",
       "      <td>60.0</td>\n",
       "      <td>18.0</td>\n",
       "      <td>25.0</td>\n",
       "      <td>NaN</td>\n",
       "      <td>NaN</td>\n",
       "      <td>0.5</td>\n",
       "      <td>NaN</td>\n",
       "      <td>1.05</td>\n",
       "      <td>1.03</td>\n",
       "      <td>1.03</td>\n",
       "      <td>1.03</td>\n",
       "      <td>0.97</td>\n",
       "      <td>0.85</td>\n",
       "      <td>1.03</td>\n",
       "      <td>37.62</td>\n",
       "      <td>36.31</td>\n",
       "      <td>39.33</td>\n",
       "      <td>97</td>\n",
       "      <td>23</td>\n",
       "      <td>0</td>\n",
       "      <td>1.197871</td>\n",
       "      <td>2.547579</td>\n",
       "      <td>8.708534</td>\n",
       "      <td>10.762977</td>\n",
       "      <td>0.084063</td>\n",
       "      <td>0.106436</td>\n",
       "      <td>0.132465</td>\n",
       "      <td>0.140155</td>\n",
       "      <td>51</td>\n",
       "      <td>32</td>\n",
       "      <td>19</td>\n",
       "      <td>24</td>\n",
       "      <td>0</td>\n",
       "      <td>0</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>85</th>\n",
       "      <td>NaN</td>\n",
       "      <td>nan</td>\n",
       "      <td>Afghanistan</td>\n",
       "      <td>33.0</td>\n",
       "      <td>65.0</td>\n",
       "      <td>2020-04-16</td>\n",
       "      <td>229.833015</td>\n",
       "      <td>3.810790</td>\n",
       "      <td>36.0</td>\n",
       "      <td>Afghanistan</td>\n",
       "      <td>107</td>\n",
       "      <td>0.763740</td>\n",
       "      <td>0.073880</td>\n",
       "      <td>20.475517</td>\n",
       "      <td>Afghanistan</td>\n",
       "      <td>528.154</td>\n",
       "      <td>1692.57</td>\n",
       "      <td>320.469</td>\n",
       "      <td>14300.19</td>\n",
       "      <td>45827.64</td>\n",
       "      <td>NaN</td>\n",
       "      <td>75.87</td>\n",
       "      <td>2054.23</td>\n",
       "      <td>0.053</td>\n",
       "      <td>22.309</td>\n",
       "      <td>18.346</td>\n",
       "      <td>20.174</td>\n",
       "      <td>124.809</td>\n",
       "      <td>131.29</td>\n",
       "      <td>NaN</td>\n",
       "      <td>3.559</td>\n",
       "      <td>2.773</td>\n",
       "      <td>13.252</td>\n",
       "      <td>17.026</td>\n",
       "      <td>NaN</td>\n",
       "      <td>NaN</td>\n",
       "      <td>36.933</td>\n",
       "      <td>469.79</td>\n",
       "      <td>467.62</td>\n",
       "      <td>2.17</td>\n",
       "      <td>NaN</td>\n",
       "      <td>2.532</td>\n",
       "      <td>NaN</td>\n",
       "      <td>101.669</td>\n",
       "      <td>1692.57</td>\n",
       "      <td>0.425</td>\n",
       "      <td>64.5</td>\n",
       "      <td>38928346.0</td>\n",
       "      <td>60.0</td>\n",
       "      <td>18.0</td>\n",
       "      <td>25.0</td>\n",
       "      <td>NaN</td>\n",
       "      <td>NaN</td>\n",
       "      <td>0.5</td>\n",
       "      <td>NaN</td>\n",
       "      <td>1.05</td>\n",
       "      <td>1.03</td>\n",
       "      <td>1.03</td>\n",
       "      <td>1.03</td>\n",
       "      <td>0.97</td>\n",
       "      <td>0.85</td>\n",
       "      <td>1.03</td>\n",
       "      <td>37.62</td>\n",
       "      <td>36.31</td>\n",
       "      <td>39.33</td>\n",
       "      <td>98</td>\n",
       "      <td>23</td>\n",
       "      <td>0</td>\n",
       "      <td>0.935649</td>\n",
       "      <td>1.948455</td>\n",
       "      <td>8.076170</td>\n",
       "      <td>10.885245</td>\n",
       "      <td>0.083516</td>\n",
       "      <td>0.099881</td>\n",
       "      <td>0.131848</td>\n",
       "      <td>0.133868</td>\n",
       "      <td>52</td>\n",
       "      <td>33</td>\n",
       "      <td>20</td>\n",
       "      <td>25</td>\n",
       "      <td>0</td>\n",
       "      <td>0</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>86</th>\n",
       "      <td>NaN</td>\n",
       "      <td>nan</td>\n",
       "      <td>Afghanistan</td>\n",
       "      <td>33.0</td>\n",
       "      <td>65.0</td>\n",
       "      <td>2020-04-17</td>\n",
       "      <td>230.512707</td>\n",
       "      <td>3.877004</td>\n",
       "      <td>37.0</td>\n",
       "      <td>Afghanistan</td>\n",
       "      <td>108</td>\n",
       "      <td>0.679692</td>\n",
       "      <td>0.066214</td>\n",
       "      <td>20.475517</td>\n",
       "      <td>Afghanistan</td>\n",
       "      <td>528.154</td>\n",
       "      <td>1692.57</td>\n",
       "      <td>320.469</td>\n",
       "      <td>14300.19</td>\n",
       "      <td>45827.64</td>\n",
       "      <td>NaN</td>\n",
       "      <td>75.87</td>\n",
       "      <td>2054.23</td>\n",
       "      <td>0.053</td>\n",
       "      <td>22.309</td>\n",
       "      <td>18.346</td>\n",
       "      <td>20.174</td>\n",
       "      <td>124.809</td>\n",
       "      <td>131.29</td>\n",
       "      <td>NaN</td>\n",
       "      <td>3.559</td>\n",
       "      <td>2.773</td>\n",
       "      <td>13.252</td>\n",
       "      <td>17.026</td>\n",
       "      <td>NaN</td>\n",
       "      <td>NaN</td>\n",
       "      <td>36.933</td>\n",
       "      <td>469.79</td>\n",
       "      <td>467.62</td>\n",
       "      <td>2.17</td>\n",
       "      <td>NaN</td>\n",
       "      <td>2.532</td>\n",
       "      <td>NaN</td>\n",
       "      <td>101.669</td>\n",
       "      <td>1692.57</td>\n",
       "      <td>0.425</td>\n",
       "      <td>64.5</td>\n",
       "      <td>38928346.0</td>\n",
       "      <td>60.0</td>\n",
       "      <td>18.0</td>\n",
       "      <td>25.0</td>\n",
       "      <td>NaN</td>\n",
       "      <td>NaN</td>\n",
       "      <td>0.5</td>\n",
       "      <td>NaN</td>\n",
       "      <td>1.05</td>\n",
       "      <td>1.03</td>\n",
       "      <td>1.03</td>\n",
       "      <td>1.03</td>\n",
       "      <td>0.97</td>\n",
       "      <td>0.85</td>\n",
       "      <td>1.03</td>\n",
       "      <td>37.62</td>\n",
       "      <td>36.31</td>\n",
       "      <td>39.33</td>\n",
       "      <td>99</td>\n",
       "      <td>23</td>\n",
       "      <td>0</td>\n",
       "      <td>0.763740</td>\n",
       "      <td>1.608040</td>\n",
       "      <td>7.315651</td>\n",
       "      <td>10.872678</td>\n",
       "      <td>0.073880</td>\n",
       "      <td>0.093085</td>\n",
       "      <td>0.130505</td>\n",
       "      <td>0.135079</td>\n",
       "      <td>53</td>\n",
       "      <td>34</td>\n",
       "      <td>21</td>\n",
       "      <td>26</td>\n",
       "      <td>0</td>\n",
       "      <td>0</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>87</th>\n",
       "      <td>NaN</td>\n",
       "      <td>nan</td>\n",
       "      <td>Afghanistan</td>\n",
       "      <td>33.0</td>\n",
       "      <td>65.0</td>\n",
       "      <td>2020-04-18</td>\n",
       "      <td>231.148193</td>\n",
       "      <td>3.943217</td>\n",
       "      <td>38.0</td>\n",
       "      <td>Afghanistan</td>\n",
       "      <td>109</td>\n",
       "      <td>0.635486</td>\n",
       "      <td>0.066214</td>\n",
       "      <td>20.475517</td>\n",
       "      <td>Afghanistan</td>\n",
       "      <td>528.154</td>\n",
       "      <td>1692.57</td>\n",
       "      <td>320.469</td>\n",
       "      <td>14300.19</td>\n",
       "      <td>45827.64</td>\n",
       "      <td>NaN</td>\n",
       "      <td>75.87</td>\n",
       "      <td>2054.23</td>\n",
       "      <td>0.053</td>\n",
       "      <td>22.309</td>\n",
       "      <td>18.346</td>\n",
       "      <td>20.174</td>\n",
       "      <td>124.809</td>\n",
       "      <td>131.29</td>\n",
       "      <td>NaN</td>\n",
       "      <td>3.559</td>\n",
       "      <td>2.773</td>\n",
       "      <td>13.252</td>\n",
       "      <td>17.026</td>\n",
       "      <td>NaN</td>\n",
       "      <td>NaN</td>\n",
       "      <td>36.933</td>\n",
       "      <td>469.79</td>\n",
       "      <td>467.62</td>\n",
       "      <td>2.17</td>\n",
       "      <td>NaN</td>\n",
       "      <td>2.532</td>\n",
       "      <td>NaN</td>\n",
       "      <td>101.669</td>\n",
       "      <td>1692.57</td>\n",
       "      <td>0.425</td>\n",
       "      <td>64.5</td>\n",
       "      <td>38928346.0</td>\n",
       "      <td>60.0</td>\n",
       "      <td>18.0</td>\n",
       "      <td>25.0</td>\n",
       "      <td>NaN</td>\n",
       "      <td>NaN</td>\n",
       "      <td>0.5</td>\n",
       "      <td>NaN</td>\n",
       "      <td>1.05</td>\n",
       "      <td>1.03</td>\n",
       "      <td>1.03</td>\n",
       "      <td>1.03</td>\n",
       "      <td>0.97</td>\n",
       "      <td>0.85</td>\n",
       "      <td>1.03</td>\n",
       "      <td>37.62</td>\n",
       "      <td>36.31</td>\n",
       "      <td>39.33</td>\n",
       "      <td>100</td>\n",
       "      <td>23</td>\n",
       "      <td>0</td>\n",
       "      <td>0.679692</td>\n",
       "      <td>1.302339</td>\n",
       "      <td>6.481209</td>\n",
       "      <td>10.681087</td>\n",
       "      <td>0.066214</td>\n",
       "      <td>0.085845</td>\n",
       "      <td>0.128511</td>\n",
       "      <td>0.136290</td>\n",
       "      <td>54</td>\n",
       "      <td>35</td>\n",
       "      <td>22</td>\n",
       "      <td>27</td>\n",
       "      <td>0</td>\n",
       "      <td>0</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>88</th>\n",
       "      <td>NaN</td>\n",
       "      <td>nan</td>\n",
       "      <td>Afghanistan</td>\n",
       "      <td>33.0</td>\n",
       "      <td>65.0</td>\n",
       "      <td>2020-04-19</td>\n",
       "      <td>231.784786</td>\n",
       "      <td>4.009431</td>\n",
       "      <td>39.0</td>\n",
       "      <td>Afghanistan</td>\n",
       "      <td>110</td>\n",
       "      <td>0.636594</td>\n",
       "      <td>0.066214</td>\n",
       "      <td>20.475517</td>\n",
       "      <td>Afghanistan</td>\n",
       "      <td>528.154</td>\n",
       "      <td>1692.57</td>\n",
       "      <td>320.469</td>\n",
       "      <td>14300.19</td>\n",
       "      <td>45827.64</td>\n",
       "      <td>NaN</td>\n",
       "      <td>75.87</td>\n",
       "      <td>2054.23</td>\n",
       "      <td>0.053</td>\n",
       "      <td>22.309</td>\n",
       "      <td>18.346</td>\n",
       "      <td>20.174</td>\n",
       "      <td>124.809</td>\n",
       "      <td>131.29</td>\n",
       "      <td>NaN</td>\n",
       "      <td>3.559</td>\n",
       "      <td>2.773</td>\n",
       "      <td>13.252</td>\n",
       "      <td>17.026</td>\n",
       "      <td>NaN</td>\n",
       "      <td>NaN</td>\n",
       "      <td>36.933</td>\n",
       "      <td>469.79</td>\n",
       "      <td>467.62</td>\n",
       "      <td>2.17</td>\n",
       "      <td>NaN</td>\n",
       "      <td>2.532</td>\n",
       "      <td>NaN</td>\n",
       "      <td>101.669</td>\n",
       "      <td>1692.57</td>\n",
       "      <td>0.425</td>\n",
       "      <td>64.5</td>\n",
       "      <td>38928346.0</td>\n",
       "      <td>60.0</td>\n",
       "      <td>18.0</td>\n",
       "      <td>25.0</td>\n",
       "      <td>NaN</td>\n",
       "      <td>NaN</td>\n",
       "      <td>0.5</td>\n",
       "      <td>NaN</td>\n",
       "      <td>1.05</td>\n",
       "      <td>1.03</td>\n",
       "      <td>1.03</td>\n",
       "      <td>1.03</td>\n",
       "      <td>0.97</td>\n",
       "      <td>0.85</td>\n",
       "      <td>1.03</td>\n",
       "      <td>37.62</td>\n",
       "      <td>36.31</td>\n",
       "      <td>39.33</td>\n",
       "      <td>101</td>\n",
       "      <td>23</td>\n",
       "      <td>0</td>\n",
       "      <td>0.635486</td>\n",
       "      <td>1.099422</td>\n",
       "      <td>5.518253</td>\n",
       "      <td>10.485437</td>\n",
       "      <td>0.066214</td>\n",
       "      <td>0.079179</td>\n",
       "      <td>0.125943</td>\n",
       "      <td>0.137295</td>\n",
       "      <td>55</td>\n",
       "      <td>36</td>\n",
       "      <td>23</td>\n",
       "      <td>28</td>\n",
       "      <td>0</td>\n",
       "      <td>0</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>89</th>\n",
       "      <td>NaN</td>\n",
       "      <td>nan</td>\n",
       "      <td>Afghanistan</td>\n",
       "      <td>33.0</td>\n",
       "      <td>65.0</td>\n",
       "      <td>2020-04-20</td>\n",
       "      <td>232.427592</td>\n",
       "      <td>4.075645</td>\n",
       "      <td>40.0</td>\n",
       "      <td>Afghanistan</td>\n",
       "      <td>111</td>\n",
       "      <td>0.642806</td>\n",
       "      <td>0.066214</td>\n",
       "      <td>20.475517</td>\n",
       "      <td>Afghanistan</td>\n",
       "      <td>528.154</td>\n",
       "      <td>1692.57</td>\n",
       "      <td>320.469</td>\n",
       "      <td>14300.19</td>\n",
       "      <td>45827.64</td>\n",
       "      <td>NaN</td>\n",
       "      <td>75.87</td>\n",
       "      <td>2054.23</td>\n",
       "      <td>0.053</td>\n",
       "      <td>22.309</td>\n",
       "      <td>18.346</td>\n",
       "      <td>20.174</td>\n",
       "      <td>124.809</td>\n",
       "      <td>131.29</td>\n",
       "      <td>NaN</td>\n",
       "      <td>3.559</td>\n",
       "      <td>2.773</td>\n",
       "      <td>13.252</td>\n",
       "      <td>17.026</td>\n",
       "      <td>NaN</td>\n",
       "      <td>NaN</td>\n",
       "      <td>36.933</td>\n",
       "      <td>469.79</td>\n",
       "      <td>467.62</td>\n",
       "      <td>2.17</td>\n",
       "      <td>NaN</td>\n",
       "      <td>2.532</td>\n",
       "      <td>NaN</td>\n",
       "      <td>101.669</td>\n",
       "      <td>1692.57</td>\n",
       "      <td>0.425</td>\n",
       "      <td>64.5</td>\n",
       "      <td>38928346.0</td>\n",
       "      <td>60.0</td>\n",
       "      <td>18.0</td>\n",
       "      <td>25.0</td>\n",
       "      <td>NaN</td>\n",
       "      <td>NaN</td>\n",
       "      <td>0.5</td>\n",
       "      <td>NaN</td>\n",
       "      <td>1.05</td>\n",
       "      <td>1.03</td>\n",
       "      <td>1.03</td>\n",
       "      <td>1.03</td>\n",
       "      <td>0.97</td>\n",
       "      <td>0.85</td>\n",
       "      <td>1.03</td>\n",
       "      <td>37.62</td>\n",
       "      <td>36.31</td>\n",
       "      <td>39.33</td>\n",
       "      <td>102</td>\n",
       "      <td>23</td>\n",
       "      <td>0</td>\n",
       "      <td>0.636594</td>\n",
       "      <td>0.947377</td>\n",
       "      <td>4.462483</td>\n",
       "      <td>10.096811</td>\n",
       "      <td>0.066214</td>\n",
       "      <td>0.075205</td>\n",
       "      <td>0.119273</td>\n",
       "      <td>0.134621</td>\n",
       "      <td>56</td>\n",
       "      <td>37</td>\n",
       "      <td>24</td>\n",
       "      <td>29</td>\n",
       "      <td>0</td>\n",
       "      <td>0</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>90</th>\n",
       "      <td>NaN</td>\n",
       "      <td>nan</td>\n",
       "      <td>Afghanistan</td>\n",
       "      <td>33.0</td>\n",
       "      <td>65.0</td>\n",
       "      <td>2020-04-21</td>\n",
       "      <td>233.048832</td>\n",
       "      <td>4.141858</td>\n",
       "      <td>41.0</td>\n",
       "      <td>Afghanistan</td>\n",
       "      <td>112</td>\n",
       "      <td>0.621240</td>\n",
       "      <td>0.066214</td>\n",
       "      <td>20.475517</td>\n",
       "      <td>Afghanistan</td>\n",
       "      <td>528.154</td>\n",
       "      <td>1692.57</td>\n",
       "      <td>320.469</td>\n",
       "      <td>14300.19</td>\n",
       "      <td>45827.64</td>\n",
       "      <td>NaN</td>\n",
       "      <td>75.87</td>\n",
       "      <td>2054.23</td>\n",
       "      <td>0.053</td>\n",
       "      <td>22.309</td>\n",
       "      <td>18.346</td>\n",
       "      <td>20.174</td>\n",
       "      <td>124.809</td>\n",
       "      <td>131.29</td>\n",
       "      <td>NaN</td>\n",
       "      <td>3.559</td>\n",
       "      <td>2.773</td>\n",
       "      <td>13.252</td>\n",
       "      <td>17.026</td>\n",
       "      <td>NaN</td>\n",
       "      <td>NaN</td>\n",
       "      <td>36.933</td>\n",
       "      <td>469.79</td>\n",
       "      <td>467.62</td>\n",
       "      <td>2.17</td>\n",
       "      <td>NaN</td>\n",
       "      <td>2.532</td>\n",
       "      <td>NaN</td>\n",
       "      <td>101.669</td>\n",
       "      <td>1692.57</td>\n",
       "      <td>0.425</td>\n",
       "      <td>64.5</td>\n",
       "      <td>38928346.0</td>\n",
       "      <td>60.0</td>\n",
       "      <td>18.0</td>\n",
       "      <td>25.0</td>\n",
       "      <td>NaN</td>\n",
       "      <td>NaN</td>\n",
       "      <td>0.5</td>\n",
       "      <td>NaN</td>\n",
       "      <td>1.05</td>\n",
       "      <td>1.03</td>\n",
       "      <td>1.03</td>\n",
       "      <td>1.03</td>\n",
       "      <td>0.97</td>\n",
       "      <td>0.85</td>\n",
       "      <td>1.03</td>\n",
       "      <td>37.62</td>\n",
       "      <td>36.31</td>\n",
       "      <td>39.33</td>\n",
       "      <td>103</td>\n",
       "      <td>23</td>\n",
       "      <td>0</td>\n",
       "      <td>0.642806</td>\n",
       "      <td>0.784548</td>\n",
       "      <td>3.522229</td>\n",
       "      <td>9.650230</td>\n",
       "      <td>0.066214</td>\n",
       "      <td>0.072330</td>\n",
       "      <td>0.112913</td>\n",
       "      <td>0.134211</td>\n",
       "      <td>57</td>\n",
       "      <td>38</td>\n",
       "      <td>25</td>\n",
       "      <td>30</td>\n",
       "      <td>0</td>\n",
       "      <td>0</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>91</th>\n",
       "      <td>NaN</td>\n",
       "      <td>nan</td>\n",
       "      <td>Afghanistan</td>\n",
       "      <td>33.0</td>\n",
       "      <td>65.0</td>\n",
       "      <td>2020-04-22</td>\n",
       "      <td>233.650275</td>\n",
       "      <td>4.208072</td>\n",
       "      <td>42.0</td>\n",
       "      <td>Afghanistan</td>\n",
       "      <td>113</td>\n",
       "      <td>0.601443</td>\n",
       "      <td>0.066214</td>\n",
       "      <td>20.475517</td>\n",
       "      <td>Afghanistan</td>\n",
       "      <td>528.154</td>\n",
       "      <td>1692.57</td>\n",
       "      <td>320.469</td>\n",
       "      <td>14300.19</td>\n",
       "      <td>45827.64</td>\n",
       "      <td>NaN</td>\n",
       "      <td>75.87</td>\n",
       "      <td>2054.23</td>\n",
       "      <td>0.053</td>\n",
       "      <td>22.309</td>\n",
       "      <td>18.346</td>\n",
       "      <td>20.174</td>\n",
       "      <td>124.809</td>\n",
       "      <td>131.29</td>\n",
       "      <td>NaN</td>\n",
       "      <td>3.559</td>\n",
       "      <td>2.773</td>\n",
       "      <td>13.252</td>\n",
       "      <td>17.026</td>\n",
       "      <td>NaN</td>\n",
       "      <td>NaN</td>\n",
       "      <td>36.933</td>\n",
       "      <td>469.79</td>\n",
       "      <td>467.62</td>\n",
       "      <td>2.17</td>\n",
       "      <td>NaN</td>\n",
       "      <td>2.532</td>\n",
       "      <td>NaN</td>\n",
       "      <td>101.669</td>\n",
       "      <td>1692.57</td>\n",
       "      <td>0.425</td>\n",
       "      <td>64.5</td>\n",
       "      <td>38928346.0</td>\n",
       "      <td>60.0</td>\n",
       "      <td>18.0</td>\n",
       "      <td>25.0</td>\n",
       "      <td>NaN</td>\n",
       "      <td>NaN</td>\n",
       "      <td>0.5</td>\n",
       "      <td>NaN</td>\n",
       "      <td>1.05</td>\n",
       "      <td>1.03</td>\n",
       "      <td>1.03</td>\n",
       "      <td>1.03</td>\n",
       "      <td>0.97</td>\n",
       "      <td>0.85</td>\n",
       "      <td>1.03</td>\n",
       "      <td>37.62</td>\n",
       "      <td>36.31</td>\n",
       "      <td>39.33</td>\n",
       "      <td>104</td>\n",
       "      <td>23</td>\n",
       "      <td>0</td>\n",
       "      <td>0.621240</td>\n",
       "      <td>0.702172</td>\n",
       "      <td>2.547579</td>\n",
       "      <td>8.708534</td>\n",
       "      <td>0.066214</td>\n",
       "      <td>0.069781</td>\n",
       "      <td>0.106436</td>\n",
       "      <td>0.132465</td>\n",
       "      <td>58</td>\n",
       "      <td>39</td>\n",
       "      <td>26</td>\n",
       "      <td>31</td>\n",
       "      <td>0</td>\n",
       "      <td>0</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>92</th>\n",
       "      <td>NaN</td>\n",
       "      <td>nan</td>\n",
       "      <td>Afghanistan</td>\n",
       "      <td>33.0</td>\n",
       "      <td>65.0</td>\n",
       "      <td>2020-04-23</td>\n",
       "      <td>234.307361</td>\n",
       "      <td>4.274286</td>\n",
       "      <td>43.0</td>\n",
       "      <td>Afghanistan</td>\n",
       "      <td>114</td>\n",
       "      <td>0.657086</td>\n",
       "      <td>0.066214</td>\n",
       "      <td>20.475517</td>\n",
       "      <td>Afghanistan</td>\n",
       "      <td>528.154</td>\n",
       "      <td>1692.57</td>\n",
       "      <td>320.469</td>\n",
       "      <td>14300.19</td>\n",
       "      <td>45827.64</td>\n",
       "      <td>NaN</td>\n",
       "      <td>75.87</td>\n",
       "      <td>2054.23</td>\n",
       "      <td>0.053</td>\n",
       "      <td>22.309</td>\n",
       "      <td>18.346</td>\n",
       "      <td>20.174</td>\n",
       "      <td>124.809</td>\n",
       "      <td>131.29</td>\n",
       "      <td>NaN</td>\n",
       "      <td>3.559</td>\n",
       "      <td>2.773</td>\n",
       "      <td>13.252</td>\n",
       "      <td>17.026</td>\n",
       "      <td>NaN</td>\n",
       "      <td>NaN</td>\n",
       "      <td>36.933</td>\n",
       "      <td>469.79</td>\n",
       "      <td>467.62</td>\n",
       "      <td>2.17</td>\n",
       "      <td>NaN</td>\n",
       "      <td>2.532</td>\n",
       "      <td>NaN</td>\n",
       "      <td>101.669</td>\n",
       "      <td>1692.57</td>\n",
       "      <td>0.425</td>\n",
       "      <td>64.5</td>\n",
       "      <td>38928346.0</td>\n",
       "      <td>60.0</td>\n",
       "      <td>18.0</td>\n",
       "      <td>25.0</td>\n",
       "      <td>NaN</td>\n",
       "      <td>NaN</td>\n",
       "      <td>0.5</td>\n",
       "      <td>NaN</td>\n",
       "      <td>1.05</td>\n",
       "      <td>1.03</td>\n",
       "      <td>1.03</td>\n",
       "      <td>1.03</td>\n",
       "      <td>0.97</td>\n",
       "      <td>0.85</td>\n",
       "      <td>1.03</td>\n",
       "      <td>37.62</td>\n",
       "      <td>36.31</td>\n",
       "      <td>39.33</td>\n",
       "      <td>105</td>\n",
       "      <td>23</td>\n",
       "      <td>0</td>\n",
       "      <td>0.601443</td>\n",
       "      <td>0.654429</td>\n",
       "      <td>1.948455</td>\n",
       "      <td>8.076170</td>\n",
       "      <td>0.066214</td>\n",
       "      <td>0.067309</td>\n",
       "      <td>0.099881</td>\n",
       "      <td>0.131848</td>\n",
       "      <td>59</td>\n",
       "      <td>40</td>\n",
       "      <td>27</td>\n",
       "      <td>32</td>\n",
       "      <td>0</td>\n",
       "      <td>0</td>\n",
       "    </tr>\n",
       "  </tbody>\n",
       "</table>\n",
       "</div>"
      ],
      "text/plain": [
       "    Id Province/State Country/Region   Lat  Long       Date  ConfirmedCases  \\\n",
       "70 NaN            nan    Afghanistan  33.0  65.0 2020-04-01      158.896905   \n",
       "71 NaN            nan    Afghanistan  33.0  65.0 2020-04-02      167.367179   \n",
       "72 NaN            nan    Afghanistan  33.0  65.0 2020-04-03      176.027870   \n",
       "73 NaN            nan    Afghanistan  33.0  65.0 2020-04-04      184.824466   \n",
       "74 NaN            nan    Afghanistan  33.0  65.0 2020-04-05      193.915763   \n",
       "75 NaN            nan    Afghanistan  33.0  65.0 2020-04-06      202.280153   \n",
       "76 NaN            nan    Afghanistan  33.0  65.0 2020-04-07      210.300575   \n",
       "77 NaN            nan    Afghanistan  33.0  65.0 2020-04-08      215.430094   \n",
       "78 NaN            nan    Afghanistan  33.0  65.0 2020-04-09      218.576738   \n",
       "79 NaN            nan    Afghanistan  33.0  65.0 2020-04-10      221.396333   \n",
       "80 NaN            nan    Afghanistan  33.0  65.0 2020-04-11      223.452238   \n",
       "81 NaN            nan    Afghanistan  33.0  65.0 2020-04-12      225.153146   \n",
       "82 NaN            nan    Afghanistan  33.0  65.0 2020-04-13      226.935755   \n",
       "83 NaN            nan    Afghanistan  33.0  65.0 2020-04-14      228.133626   \n",
       "84 NaN            nan    Afghanistan  33.0  65.0 2020-04-15      229.069275   \n",
       "85 NaN            nan    Afghanistan  33.0  65.0 2020-04-16      229.833015   \n",
       "86 NaN            nan    Afghanistan  33.0  65.0 2020-04-17      230.512707   \n",
       "87 NaN            nan    Afghanistan  33.0  65.0 2020-04-18      231.148193   \n",
       "88 NaN            nan    Afghanistan  33.0  65.0 2020-04-19      231.784786   \n",
       "89 NaN            nan    Afghanistan  33.0  65.0 2020-04-20      232.427592   \n",
       "90 NaN            nan    Afghanistan  33.0  65.0 2020-04-21      233.048832   \n",
       "91 NaN            nan    Afghanistan  33.0  65.0 2020-04-22      233.650275   \n",
       "92 NaN            nan    Afghanistan  33.0  65.0 2020-04-23      234.307361   \n",
       "\n",
       "    Fatalities  ForecastId     place_id  day  cases/day  fatal/day  \\\n",
       "70    2.114806        21.0  Afghanistan   92   9.556067   0.133722   \n",
       "71    2.245659        22.0  Afghanistan   93   8.470274   0.130852   \n",
       "72    2.376511        23.0  Afghanistan   94   8.660692   0.130852   \n",
       "73    2.507363        24.0  Afghanistan   95   8.796596   0.130852   \n",
       "74    2.648085        25.0  Afghanistan   96   9.091297   0.140722   \n",
       "75    2.778938        26.0  Afghanistan   97   8.364390   0.130852   \n",
       "76    2.908341        27.0  Afghanistan   98   8.020422   0.129404   \n",
       "77    3.037745        28.0  Afghanistan   99   5.129519   0.129404   \n",
       "78    3.159197        29.0  Afghanistan  100   3.146644   0.121452   \n",
       "79    3.276091        30.0  Afghanistan  101   2.819595   0.116894   \n",
       "80    3.388968        31.0  Afghanistan  102   2.055905   0.112877   \n",
       "81    3.482994        32.0  Afghanistan  103   1.700908   0.094026   \n",
       "82    3.569331        33.0  Afghanistan  104   1.782609   0.086337   \n",
       "83    3.653395        34.0  Afghanistan  105   1.197871   0.084063   \n",
       "84    3.736910        35.0  Afghanistan  106   0.935649   0.083516   \n",
       "85    3.810790        36.0  Afghanistan  107   0.763740   0.073880   \n",
       "86    3.877004        37.0  Afghanistan  108   0.679692   0.066214   \n",
       "87    3.943217        38.0  Afghanistan  109   0.635486   0.066214   \n",
       "88    4.009431        39.0  Afghanistan  110   0.636594   0.066214   \n",
       "89    4.075645        40.0  Afghanistan  111   0.642806   0.066214   \n",
       "90    4.141858        41.0  Afghanistan  112   0.621240   0.066214   \n",
       "91    4.208072        42.0  Afghanistan  113   0.601443   0.066214   \n",
       "92    4.274286        43.0  Afghanistan  114   0.657086   0.066214   \n",
       "\n",
       "    SmokingRate      Country  Gross_domestic_product__constant_prices  \\\n",
       "70    20.475517  Afghanistan                                  528.154   \n",
       "71    20.475517  Afghanistan                                  528.154   \n",
       "72    20.475517  Afghanistan                                  528.154   \n",
       "73    20.475517  Afghanistan                                  528.154   \n",
       "74    20.475517  Afghanistan                                  528.154   \n",
       "75    20.475517  Afghanistan                                  528.154   \n",
       "76    20.475517  Afghanistan                                  528.154   \n",
       "77    20.475517  Afghanistan                                  528.154   \n",
       "78    20.475517  Afghanistan                                  528.154   \n",
       "79    20.475517  Afghanistan                                  528.154   \n",
       "80    20.475517  Afghanistan                                  528.154   \n",
       "81    20.475517  Afghanistan                                  528.154   \n",
       "82    20.475517  Afghanistan                                  528.154   \n",
       "83    20.475517  Afghanistan                                  528.154   \n",
       "84    20.475517  Afghanistan                                  528.154   \n",
       "85    20.475517  Afghanistan                                  528.154   \n",
       "86    20.475517  Afghanistan                                  528.154   \n",
       "87    20.475517  Afghanistan                                  528.154   \n",
       "88    20.475517  Afghanistan                                  528.154   \n",
       "89    20.475517  Afghanistan                                  528.154   \n",
       "90    20.475517  Afghanistan                                  528.154   \n",
       "91    20.475517  Afghanistan                                  528.154   \n",
       "92    20.475517  Afghanistan                                  528.154   \n",
       "\n",
       "    Gross_domestic_product__current_prices  Gross_domestic_product__deflator  \\\n",
       "70                                 1692.57                           320.469   \n",
       "71                                 1692.57                           320.469   \n",
       "72                                 1692.57                           320.469   \n",
       "73                                 1692.57                           320.469   \n",
       "74                                 1692.57                           320.469   \n",
       "75                                 1692.57                           320.469   \n",
       "76                                 1692.57                           320.469   \n",
       "77                                 1692.57                           320.469   \n",
       "78                                 1692.57                           320.469   \n",
       "79                                 1692.57                           320.469   \n",
       "80                                 1692.57                           320.469   \n",
       "81                                 1692.57                           320.469   \n",
       "82                                 1692.57                           320.469   \n",
       "83                                 1692.57                           320.469   \n",
       "84                                 1692.57                           320.469   \n",
       "85                                 1692.57                           320.469   \n",
       "86                                 1692.57                           320.469   \n",
       "87                                 1692.57                           320.469   \n",
       "88                                 1692.57                           320.469   \n",
       "89                                 1692.57                           320.469   \n",
       "90                                 1692.57                           320.469   \n",
       "91                                 1692.57                           320.469   \n",
       "92                                 1692.57                           320.469   \n",
       "\n",
       "    Gross_domestic_product_per_capita__constant_prices  \\\n",
       "70                                           14300.19    \n",
       "71                                           14300.19    \n",
       "72                                           14300.19    \n",
       "73                                           14300.19    \n",
       "74                                           14300.19    \n",
       "75                                           14300.19    \n",
       "76                                           14300.19    \n",
       "77                                           14300.19    \n",
       "78                                           14300.19    \n",
       "79                                           14300.19    \n",
       "80                                           14300.19    \n",
       "81                                           14300.19    \n",
       "82                                           14300.19    \n",
       "83                                           14300.19    \n",
       "84                                           14300.19    \n",
       "85                                           14300.19    \n",
       "86                                           14300.19    \n",
       "87                                           14300.19    \n",
       "88                                           14300.19    \n",
       "89                                           14300.19    \n",
       "90                                           14300.19    \n",
       "91                                           14300.19    \n",
       "92                                           14300.19    \n",
       "\n",
       "    Gross_domestic_product_per_capita__current_prices  \\\n",
       "70                                           45827.64   \n",
       "71                                           45827.64   \n",
       "72                                           45827.64   \n",
       "73                                           45827.64   \n",
       "74                                           45827.64   \n",
       "75                                           45827.64   \n",
       "76                                           45827.64   \n",
       "77                                           45827.64   \n",
       "78                                           45827.64   \n",
       "79                                           45827.64   \n",
       "80                                           45827.64   \n",
       "81                                           45827.64   \n",
       "82                                           45827.64   \n",
       "83                                           45827.64   \n",
       "84                                           45827.64   \n",
       "85                                           45827.64   \n",
       "86                                           45827.64   \n",
       "87                                           45827.64   \n",
       "88                                           45827.64   \n",
       "89                                           45827.64   \n",
       "90                                           45827.64   \n",
       "91                                           45827.64   \n",
       "92                                           45827.64   \n",
       "\n",
       "    Output_gap_in_percent_of_potential_GDP  \\\n",
       "70                                     NaN   \n",
       "71                                     NaN   \n",
       "72                                     NaN   \n",
       "73                                     NaN   \n",
       "74                                     NaN   \n",
       "75                                     NaN   \n",
       "76                                     NaN   \n",
       "77                                     NaN   \n",
       "78                                     NaN   \n",
       "79                                     NaN   \n",
       "80                                     NaN   \n",
       "81                                     NaN   \n",
       "82                                     NaN   \n",
       "83                                     NaN   \n",
       "84                                     NaN   \n",
       "85                                     NaN   \n",
       "86                                     NaN   \n",
       "87                                     NaN   \n",
       "88                                     NaN   \n",
       "89                                     NaN   \n",
       "90                                     NaN   \n",
       "91                                     NaN   \n",
       "92                                     NaN   \n",
       "\n",
       "    Gross_domestic_product_based_on_purchasing_power_parity__PPP__valuation_of_country_GDP  \\\n",
       "70                                              75.87                                        \n",
       "71                                              75.87                                        \n",
       "72                                              75.87                                        \n",
       "73                                              75.87                                        \n",
       "74                                              75.87                                        \n",
       "75                                              75.87                                        \n",
       "76                                              75.87                                        \n",
       "77                                              75.87                                        \n",
       "78                                              75.87                                        \n",
       "79                                              75.87                                        \n",
       "80                                              75.87                                        \n",
       "81                                              75.87                                        \n",
       "82                                              75.87                                        \n",
       "83                                              75.87                                        \n",
       "84                                              75.87                                        \n",
       "85                                              75.87                                        \n",
       "86                                              75.87                                        \n",
       "87                                              75.87                                        \n",
       "88                                              75.87                                        \n",
       "89                                              75.87                                        \n",
       "90                                              75.87                                        \n",
       "91                                              75.87                                        \n",
       "92                                              75.87                                        \n",
       "\n",
       "    Gross_domestic_product_based_on_purchasing_power_parity__PPP__per_capita_GDP  \\\n",
       "70                                            2054.23                              \n",
       "71                                            2054.23                              \n",
       "72                                            2054.23                              \n",
       "73                                            2054.23                              \n",
       "74                                            2054.23                              \n",
       "75                                            2054.23                              \n",
       "76                                            2054.23                              \n",
       "77                                            2054.23                              \n",
       "78                                            2054.23                              \n",
       "79                                            2054.23                              \n",
       "80                                            2054.23                              \n",
       "81                                            2054.23                              \n",
       "82                                            2054.23                              \n",
       "83                                            2054.23                              \n",
       "84                                            2054.23                              \n",
       "85                                            2054.23                              \n",
       "86                                            2054.23                              \n",
       "87                                            2054.23                              \n",
       "88                                            2054.23                              \n",
       "89                                            2054.23                              \n",
       "90                                            2054.23                              \n",
       "91                                            2054.23                              \n",
       "92                                            2054.23                              \n",
       "\n",
       "    Gross_domestic_product_based_on_purchasing_power_parity__PPP__share_of_world_total  \\\n",
       "70                                              0.053                                    \n",
       "71                                              0.053                                    \n",
       "72                                              0.053                                    \n",
       "73                                              0.053                                    \n",
       "74                                              0.053                                    \n",
       "75                                              0.053                                    \n",
       "76                                              0.053                                    \n",
       "77                                              0.053                                    \n",
       "78                                              0.053                                    \n",
       "79                                              0.053                                    \n",
       "80                                              0.053                                    \n",
       "81                                              0.053                                    \n",
       "82                                              0.053                                    \n",
       "83                                              0.053                                    \n",
       "84                                              0.053                                    \n",
       "85                                              0.053                                    \n",
       "86                                              0.053                                    \n",
       "87                                              0.053                                    \n",
       "88                                              0.053                                    \n",
       "89                                              0.053                                    \n",
       "90                                              0.053                                    \n",
       "91                                              0.053                                    \n",
       "92                                              0.053                                    \n",
       "\n",
       "    Implied_PPP_conversion_rate  Total_investment  Gross_national_savings  \\\n",
       "70                       22.309            18.346                  20.174   \n",
       "71                       22.309            18.346                  20.174   \n",
       "72                       22.309            18.346                  20.174   \n",
       "73                       22.309            18.346                  20.174   \n",
       "74                       22.309            18.346                  20.174   \n",
       "75                       22.309            18.346                  20.174   \n",
       "76                       22.309            18.346                  20.174   \n",
       "77                       22.309            18.346                  20.174   \n",
       "78                       22.309            18.346                  20.174   \n",
       "79                       22.309            18.346                  20.174   \n",
       "80                       22.309            18.346                  20.174   \n",
       "81                       22.309            18.346                  20.174   \n",
       "82                       22.309            18.346                  20.174   \n",
       "83                       22.309            18.346                  20.174   \n",
       "84                       22.309            18.346                  20.174   \n",
       "85                       22.309            18.346                  20.174   \n",
       "86                       22.309            18.346                  20.174   \n",
       "87                       22.309            18.346                  20.174   \n",
       "88                       22.309            18.346                  20.174   \n",
       "89                       22.309            18.346                  20.174   \n",
       "90                       22.309            18.346                  20.174   \n",
       "91                       22.309            18.346                  20.174   \n",
       "92                       22.309            18.346                  20.174   \n",
       "\n",
       "    Inflation__average_consumer_prices  \\\n",
       "70                             124.809   \n",
       "71                             124.809   \n",
       "72                             124.809   \n",
       "73                             124.809   \n",
       "74                             124.809   \n",
       "75                             124.809   \n",
       "76                             124.809   \n",
       "77                             124.809   \n",
       "78                             124.809   \n",
       "79                             124.809   \n",
       "80                             124.809   \n",
       "81                             124.809   \n",
       "82                             124.809   \n",
       "83                             124.809   \n",
       "84                             124.809   \n",
       "85                             124.809   \n",
       "86                             124.809   \n",
       "87                             124.809   \n",
       "88                             124.809   \n",
       "89                             124.809   \n",
       "90                             124.809   \n",
       "91                             124.809   \n",
       "92                             124.809   \n",
       "\n",
       "    Inflation__end_of_period_consumer_prices  \\\n",
       "70                                    131.29   \n",
       "71                                    131.29   \n",
       "72                                    131.29   \n",
       "73                                    131.29   \n",
       "74                                    131.29   \n",
       "75                                    131.29   \n",
       "76                                    131.29   \n",
       "77                                    131.29   \n",
       "78                                    131.29   \n",
       "79                                    131.29   \n",
       "80                                    131.29   \n",
       "81                                    131.29   \n",
       "82                                    131.29   \n",
       "83                                    131.29   \n",
       "84                                    131.29   \n",
       "85                                    131.29   \n",
       "86                                    131.29   \n",
       "87                                    131.29   \n",
       "88                                    131.29   \n",
       "89                                    131.29   \n",
       "90                                    131.29   \n",
       "91                                    131.29   \n",
       "92                                    131.29   \n",
       "\n",
       "    Six_month_London_interbank_offered_rate__LIBOR_  \\\n",
       "70                                              NaN   \n",
       "71                                              NaN   \n",
       "72                                              NaN   \n",
       "73                                              NaN   \n",
       "74                                              NaN   \n",
       "75                                              NaN   \n",
       "76                                              NaN   \n",
       "77                                              NaN   \n",
       "78                                              NaN   \n",
       "79                                              NaN   \n",
       "80                                              NaN   \n",
       "81                                              NaN   \n",
       "82                                              NaN   \n",
       "83                                              NaN   \n",
       "84                                              NaN   \n",
       "85                                              NaN   \n",
       "86                                              NaN   \n",
       "87                                              NaN   \n",
       "88                                              NaN   \n",
       "89                                              NaN   \n",
       "90                                              NaN   \n",
       "91                                              NaN   \n",
       "92                                              NaN   \n",
       "\n",
       "    Volume_of_imports_of_goods_and_services  Volume_of_Imports_of_goods  \\\n",
       "70                                    3.559                       2.773   \n",
       "71                                    3.559                       2.773   \n",
       "72                                    3.559                       2.773   \n",
       "73                                    3.559                       2.773   \n",
       "74                                    3.559                       2.773   \n",
       "75                                    3.559                       2.773   \n",
       "76                                    3.559                       2.773   \n",
       "77                                    3.559                       2.773   \n",
       "78                                    3.559                       2.773   \n",
       "79                                    3.559                       2.773   \n",
       "80                                    3.559                       2.773   \n",
       "81                                    3.559                       2.773   \n",
       "82                                    3.559                       2.773   \n",
       "83                                    3.559                       2.773   \n",
       "84                                    3.559                       2.773   \n",
       "85                                    3.559                       2.773   \n",
       "86                                    3.559                       2.773   \n",
       "87                                    3.559                       2.773   \n",
       "88                                    3.559                       2.773   \n",
       "89                                    3.559                       2.773   \n",
       "90                                    3.559                       2.773   \n",
       "91                                    3.559                       2.773   \n",
       "92                                    3.559                       2.773   \n",
       "\n",
       "    Volume_of_exports_of_goods_and_services  Volume_of_exports_of_goods  \\\n",
       "70                                   13.252                      17.026   \n",
       "71                                   13.252                      17.026   \n",
       "72                                   13.252                      17.026   \n",
       "73                                   13.252                      17.026   \n",
       "74                                   13.252                      17.026   \n",
       "75                                   13.252                      17.026   \n",
       "76                                   13.252                      17.026   \n",
       "77                                   13.252                      17.026   \n",
       "78                                   13.252                      17.026   \n",
       "79                                   13.252                      17.026   \n",
       "80                                   13.252                      17.026   \n",
       "81                                   13.252                      17.026   \n",
       "82                                   13.252                      17.026   \n",
       "83                                   13.252                      17.026   \n",
       "84                                   13.252                      17.026   \n",
       "85                                   13.252                      17.026   \n",
       "86                                   13.252                      17.026   \n",
       "87                                   13.252                      17.026   \n",
       "88                                   13.252                      17.026   \n",
       "89                                   13.252                      17.026   \n",
       "90                                   13.252                      17.026   \n",
       "91                                   13.252                      17.026   \n",
       "92                                   13.252                      17.026   \n",
       "\n",
       "    Unemployment_rate  Employment  Population  General_government_revenue  \\\n",
       "70                NaN         NaN      36.933                      469.79   \n",
       "71                NaN         NaN      36.933                      469.79   \n",
       "72                NaN         NaN      36.933                      469.79   \n",
       "73                NaN         NaN      36.933                      469.79   \n",
       "74                NaN         NaN      36.933                      469.79   \n",
       "75                NaN         NaN      36.933                      469.79   \n",
       "76                NaN         NaN      36.933                      469.79   \n",
       "77                NaN         NaN      36.933                      469.79   \n",
       "78                NaN         NaN      36.933                      469.79   \n",
       "79                NaN         NaN      36.933                      469.79   \n",
       "80                NaN         NaN      36.933                      469.79   \n",
       "81                NaN         NaN      36.933                      469.79   \n",
       "82                NaN         NaN      36.933                      469.79   \n",
       "83                NaN         NaN      36.933                      469.79   \n",
       "84                NaN         NaN      36.933                      469.79   \n",
       "85                NaN         NaN      36.933                      469.79   \n",
       "86                NaN         NaN      36.933                      469.79   \n",
       "87                NaN         NaN      36.933                      469.79   \n",
       "88                NaN         NaN      36.933                      469.79   \n",
       "89                NaN         NaN      36.933                      469.79   \n",
       "90                NaN         NaN      36.933                      469.79   \n",
       "91                NaN         NaN      36.933                      469.79   \n",
       "92                NaN         NaN      36.933                      469.79   \n",
       "\n",
       "    General_government_total_expenditure  \\\n",
       "70                                467.62   \n",
       "71                                467.62   \n",
       "72                                467.62   \n",
       "73                                467.62   \n",
       "74                                467.62   \n",
       "75                                467.62   \n",
       "76                                467.62   \n",
       "77                                467.62   \n",
       "78                                467.62   \n",
       "79                                467.62   \n",
       "80                                467.62   \n",
       "81                                467.62   \n",
       "82                                467.62   \n",
       "83                                467.62   \n",
       "84                                467.62   \n",
       "85                                467.62   \n",
       "86                                467.62   \n",
       "87                                467.62   \n",
       "88                                467.62   \n",
       "89                                467.62   \n",
       "90                                467.62   \n",
       "91                                467.62   \n",
       "92                                467.62   \n",
       "\n",
       "    General_government_net_lending_borrowing  \\\n",
       "70                                      2.17   \n",
       "71                                      2.17   \n",
       "72                                      2.17   \n",
       "73                                      2.17   \n",
       "74                                      2.17   \n",
       "75                                      2.17   \n",
       "76                                      2.17   \n",
       "77                                      2.17   \n",
       "78                                      2.17   \n",
       "79                                      2.17   \n",
       "80                                      2.17   \n",
       "81                                      2.17   \n",
       "82                                      2.17   \n",
       "83                                      2.17   \n",
       "84                                      2.17   \n",
       "85                                      2.17   \n",
       "86                                      2.17   \n",
       "87                                      2.17   \n",
       "88                                      2.17   \n",
       "89                                      2.17   \n",
       "90                                      2.17   \n",
       "91                                      2.17   \n",
       "92                                      2.17   \n",
       "\n",
       "    General_government_structural_balance  \\\n",
       "70                                    NaN   \n",
       "71                                    NaN   \n",
       "72                                    NaN   \n",
       "73                                    NaN   \n",
       "74                                    NaN   \n",
       "75                                    NaN   \n",
       "76                                    NaN   \n",
       "77                                    NaN   \n",
       "78                                    NaN   \n",
       "79                                    NaN   \n",
       "80                                    NaN   \n",
       "81                                    NaN   \n",
       "82                                    NaN   \n",
       "83                                    NaN   \n",
       "84                                    NaN   \n",
       "85                                    NaN   \n",
       "86                                    NaN   \n",
       "87                                    NaN   \n",
       "88                                    NaN   \n",
       "89                                    NaN   \n",
       "90                                    NaN   \n",
       "91                                    NaN   \n",
       "92                                    NaN   \n",
       "\n",
       "    General_government_primary_net_lending_borrowing  \\\n",
       "70                                             2.532   \n",
       "71                                             2.532   \n",
       "72                                             2.532   \n",
       "73                                             2.532   \n",
       "74                                             2.532   \n",
       "75                                             2.532   \n",
       "76                                             2.532   \n",
       "77                                             2.532   \n",
       "78                                             2.532   \n",
       "79                                             2.532   \n",
       "80                                             2.532   \n",
       "81                                             2.532   \n",
       "82                                             2.532   \n",
       "83                                             2.532   \n",
       "84                                             2.532   \n",
       "85                                             2.532   \n",
       "86                                             2.532   \n",
       "87                                             2.532   \n",
       "88                                             2.532   \n",
       "89                                             2.532   \n",
       "90                                             2.532   \n",
       "91                                             2.532   \n",
       "92                                             2.532   \n",
       "\n",
       "    General_government_net_debt  General_government_gross_debt  \\\n",
       "70                          NaN                        101.669   \n",
       "71                          NaN                        101.669   \n",
       "72                          NaN                        101.669   \n",
       "73                          NaN                        101.669   \n",
       "74                          NaN                        101.669   \n",
       "75                          NaN                        101.669   \n",
       "76                          NaN                        101.669   \n",
       "77                          NaN                        101.669   \n",
       "78                          NaN                        101.669   \n",
       "79                          NaN                        101.669   \n",
       "80                          NaN                        101.669   \n",
       "81                          NaN                        101.669   \n",
       "82                          NaN                        101.669   \n",
       "83                          NaN                        101.669   \n",
       "84                          NaN                        101.669   \n",
       "85                          NaN                        101.669   \n",
       "86                          NaN                        101.669   \n",
       "87                          NaN                        101.669   \n",
       "88                          NaN                        101.669   \n",
       "89                          NaN                        101.669   \n",
       "90                          NaN                        101.669   \n",
       "91                          NaN                        101.669   \n",
       "92                          NaN                        101.669   \n",
       "\n",
       "    Gross_domestic_product_corresponding_to_fiscal_year__current_prices  \\\n",
       "70                                            1692.57                     \n",
       "71                                            1692.57                     \n",
       "72                                            1692.57                     \n",
       "73                                            1692.57                     \n",
       "74                                            1692.57                     \n",
       "75                                            1692.57                     \n",
       "76                                            1692.57                     \n",
       "77                                            1692.57                     \n",
       "78                                            1692.57                     \n",
       "79                                            1692.57                     \n",
       "80                                            1692.57                     \n",
       "81                                            1692.57                     \n",
       "82                                            1692.57                     \n",
       "83                                            1692.57                     \n",
       "84                                            1692.57                     \n",
       "85                                            1692.57                     \n",
       "86                                            1692.57                     \n",
       "87                                            1692.57                     \n",
       "88                                            1692.57                     \n",
       "89                                            1692.57                     \n",
       "90                                            1692.57                     \n",
       "91                                            1692.57                     \n",
       "92                                            1692.57                     \n",
       "\n",
       "    Current_account_balance  LifeExpectancy         pop  density  medianage  \\\n",
       "70                    0.425            64.5  38928346.0     60.0       18.0   \n",
       "71                    0.425            64.5  38928346.0     60.0       18.0   \n",
       "72                    0.425            64.5  38928346.0     60.0       18.0   \n",
       "73                    0.425            64.5  38928346.0     60.0       18.0   \n",
       "74                    0.425            64.5  38928346.0     60.0       18.0   \n",
       "75                    0.425            64.5  38928346.0     60.0       18.0   \n",
       "76                    0.425            64.5  38928346.0     60.0       18.0   \n",
       "77                    0.425            64.5  38928346.0     60.0       18.0   \n",
       "78                    0.425            64.5  38928346.0     60.0       18.0   \n",
       "79                    0.425            64.5  38928346.0     60.0       18.0   \n",
       "80                    0.425            64.5  38928346.0     60.0       18.0   \n",
       "81                    0.425            64.5  38928346.0     60.0       18.0   \n",
       "82                    0.425            64.5  38928346.0     60.0       18.0   \n",
       "83                    0.425            64.5  38928346.0     60.0       18.0   \n",
       "84                    0.425            64.5  38928346.0     60.0       18.0   \n",
       "85                    0.425            64.5  38928346.0     60.0       18.0   \n",
       "86                    0.425            64.5  38928346.0     60.0       18.0   \n",
       "87                    0.425            64.5  38928346.0     60.0       18.0   \n",
       "88                    0.425            64.5  38928346.0     60.0       18.0   \n",
       "89                    0.425            64.5  38928346.0     60.0       18.0   \n",
       "90                    0.425            64.5  38928346.0     60.0       18.0   \n",
       "91                    0.425            64.5  38928346.0     60.0       18.0   \n",
       "92                    0.425            64.5  38928346.0     60.0       18.0   \n",
       "\n",
       "    urbanpop quarantine schools  hospibed  smokers  sex0  sex14  sex25  sex54  \\\n",
       "70      25.0        NaN     NaN       0.5      NaN  1.05   1.03   1.03   1.03   \n",
       "71      25.0        NaN     NaN       0.5      NaN  1.05   1.03   1.03   1.03   \n",
       "72      25.0        NaN     NaN       0.5      NaN  1.05   1.03   1.03   1.03   \n",
       "73      25.0        NaN     NaN       0.5      NaN  1.05   1.03   1.03   1.03   \n",
       "74      25.0        NaN     NaN       0.5      NaN  1.05   1.03   1.03   1.03   \n",
       "75      25.0        NaN     NaN       0.5      NaN  1.05   1.03   1.03   1.03   \n",
       "76      25.0        NaN     NaN       0.5      NaN  1.05   1.03   1.03   1.03   \n",
       "77      25.0        NaN     NaN       0.5      NaN  1.05   1.03   1.03   1.03   \n",
       "78      25.0        NaN     NaN       0.5      NaN  1.05   1.03   1.03   1.03   \n",
       "79      25.0        NaN     NaN       0.5      NaN  1.05   1.03   1.03   1.03   \n",
       "80      25.0        NaN     NaN       0.5      NaN  1.05   1.03   1.03   1.03   \n",
       "81      25.0        NaN     NaN       0.5      NaN  1.05   1.03   1.03   1.03   \n",
       "82      25.0        NaN     NaN       0.5      NaN  1.05   1.03   1.03   1.03   \n",
       "83      25.0        NaN     NaN       0.5      NaN  1.05   1.03   1.03   1.03   \n",
       "84      25.0        NaN     NaN       0.5      NaN  1.05   1.03   1.03   1.03   \n",
       "85      25.0        NaN     NaN       0.5      NaN  1.05   1.03   1.03   1.03   \n",
       "86      25.0        NaN     NaN       0.5      NaN  1.05   1.03   1.03   1.03   \n",
       "87      25.0        NaN     NaN       0.5      NaN  1.05   1.03   1.03   1.03   \n",
       "88      25.0        NaN     NaN       0.5      NaN  1.05   1.03   1.03   1.03   \n",
       "89      25.0        NaN     NaN       0.5      NaN  1.05   1.03   1.03   1.03   \n",
       "90      25.0        NaN     NaN       0.5      NaN  1.05   1.03   1.03   1.03   \n",
       "91      25.0        NaN     NaN       0.5      NaN  1.05   1.03   1.03   1.03   \n",
       "92      25.0        NaN     NaN       0.5      NaN  1.05   1.03   1.03   1.03   \n",
       "\n",
       "    sex64  sex65plus  sexratio   lung  femalelung  malelung   id  \\\n",
       "70   0.97       0.85      1.03  37.62       36.31     39.33   83   \n",
       "71   0.97       0.85      1.03  37.62       36.31     39.33   84   \n",
       "72   0.97       0.85      1.03  37.62       36.31     39.33   85   \n",
       "73   0.97       0.85      1.03  37.62       36.31     39.33   86   \n",
       "74   0.97       0.85      1.03  37.62       36.31     39.33   87   \n",
       "75   0.97       0.85      1.03  37.62       36.31     39.33   88   \n",
       "76   0.97       0.85      1.03  37.62       36.31     39.33   89   \n",
       "77   0.97       0.85      1.03  37.62       36.31     39.33   90   \n",
       "78   0.97       0.85      1.03  37.62       36.31     39.33   91   \n",
       "79   0.97       0.85      1.03  37.62       36.31     39.33   92   \n",
       "80   0.97       0.85      1.03  37.62       36.31     39.33   93   \n",
       "81   0.97       0.85      1.03  37.62       36.31     39.33   94   \n",
       "82   0.97       0.85      1.03  37.62       36.31     39.33   95   \n",
       "83   0.97       0.85      1.03  37.62       36.31     39.33   96   \n",
       "84   0.97       0.85      1.03  37.62       36.31     39.33   97   \n",
       "85   0.97       0.85      1.03  37.62       36.31     39.33   98   \n",
       "86   0.97       0.85      1.03  37.62       36.31     39.33   99   \n",
       "87   0.97       0.85      1.03  37.62       36.31     39.33  100   \n",
       "88   0.97       0.85      1.03  37.62       36.31     39.33  101   \n",
       "89   0.97       0.85      1.03  37.62       36.31     39.33  102   \n",
       "90   0.97       0.85      1.03  37.62       36.31     39.33  103   \n",
       "91   0.97       0.85      1.03  37.62       36.31     39.33  104   \n",
       "92   0.97       0.85      1.03  37.62       36.31     39.33  105   \n",
       "\n",
       "    Country/Region_le  Province/State_le  cases/day-(1-1)  cases/day-(1-7)  \\\n",
       "70                 23                  0        14.612295        10.762977   \n",
       "71                 23                  0         9.556067        10.885245   \n",
       "72                 23                  0         8.470274        10.872678   \n",
       "73                 23                  0         8.660692        10.681087   \n",
       "74                 23                  0         8.796596        10.485437   \n",
       "75                 23                  0         9.091297        10.096811   \n",
       "76                 23                  0         8.364390         9.650230   \n",
       "77                 23                  0         8.020422         8.708534   \n",
       "78                 23                  0         5.129519         8.076170   \n",
       "79                 23                  0         3.146644         7.315651   \n",
       "80                 23                  0         2.819595         6.481209   \n",
       "81                 23                  0         2.055905         5.518253   \n",
       "82                 23                  0         1.700908         4.462483   \n",
       "83                 23                  0         1.782609         3.522229   \n",
       "84                 23                  0         1.197871         2.547579   \n",
       "85                 23                  0         0.935649         1.948455   \n",
       "86                 23                  0         0.763740         1.608040   \n",
       "87                 23                  0         0.679692         1.302339   \n",
       "88                 23                  0         0.635486         1.099422   \n",
       "89                 23                  0         0.636594         0.947377   \n",
       "90                 23                  0         0.642806         0.784548   \n",
       "91                 23                  0         0.621240         0.702172   \n",
       "92                 23                  0         0.601443         0.654429   \n",
       "\n",
       "    cases/day-(8-14)  cases/day-(15-21)  fatal/day-(1-1)  fatal/day-(1-7)  \\\n",
       "70          7.428571           2.428571         0.141621         0.140155   \n",
       "71          8.671456           2.142857         0.133722         0.133868   \n",
       "72          9.894062           2.142857         0.130852         0.135079   \n",
       "73         11.037180           2.428571         0.130852         0.136290   \n",
       "74         12.489486           1.857143         0.130852         0.137295   \n",
       "75         11.891155           3.428571         0.140722         0.134621   \n",
       "76         13.532649           2.714286         0.130852         0.134211   \n",
       "77         10.762977           7.428571         0.129404         0.132465   \n",
       "78         10.885245           8.671456         0.129404         0.131848   \n",
       "79         10.872678           9.894062         0.121452         0.130505   \n",
       "80         10.681087          11.037180         0.116894         0.128511   \n",
       "81         10.485437          12.489486         0.112877         0.125943   \n",
       "82         10.096811          11.891155         0.094026         0.119273   \n",
       "83          9.650230          13.532649         0.086337         0.112913   \n",
       "84          8.708534          10.762977         0.084063         0.106436   \n",
       "85          8.076170          10.885245         0.083516         0.099881   \n",
       "86          7.315651          10.872678         0.073880         0.093085   \n",
       "87          6.481209          10.681087         0.066214         0.085845   \n",
       "88          5.518253          10.485437         0.066214         0.079179   \n",
       "89          4.462483          10.096811         0.066214         0.075205   \n",
       "90          3.522229           9.650230         0.066214         0.072330   \n",
       "91          2.547579           8.708534         0.066214         0.069781   \n",
       "92          1.948455           8.076170         0.066214         0.067309   \n",
       "\n",
       "    fatal/day-(8-14)  fatal/day-(15-21)  days_since_1cases  \\\n",
       "70          0.142857           0.000000                 37   \n",
       "71          0.168247           0.000000                 38   \n",
       "72          0.185729           0.000000                 39   \n",
       "73          0.203212           0.000000                 40   \n",
       "74          0.220900           0.000000                 41   \n",
       "75          0.100820           0.142857                 42   \n",
       "76          0.119923           0.142857                 43   \n",
       "77          0.140155           0.142857                 44   \n",
       "78          0.133868           0.168247                 45   \n",
       "79          0.135079           0.185729                 46   \n",
       "80          0.136290           0.203212                 47   \n",
       "81          0.137295           0.220900                 48   \n",
       "82          0.134621           0.100820                 49   \n",
       "83          0.134211           0.119923                 50   \n",
       "84          0.132465           0.140155                 51   \n",
       "85          0.131848           0.133868                 52   \n",
       "86          0.130505           0.135079                 53   \n",
       "87          0.128511           0.136290                 54   \n",
       "88          0.125943           0.137295                 55   \n",
       "89          0.119273           0.134621                 56   \n",
       "90          0.112913           0.134211                 57   \n",
       "91          0.106436           0.132465                 58   \n",
       "92          0.099881           0.131848                 59   \n",
       "\n",
       "    days_since_10cases  days_since_100cases  days_since_1fatal  \\\n",
       "70                  18                    5                 10   \n",
       "71                  19                    6                 11   \n",
       "72                  20                    7                 12   \n",
       "73                  21                    8                 13   \n",
       "74                  22                    9                 14   \n",
       "75                  23                   10                 15   \n",
       "76                  24                   11                 16   \n",
       "77                  25                   12                 17   \n",
       "78                  26                   13                 18   \n",
       "79                  27                   14                 19   \n",
       "80                  28                   15                 20   \n",
       "81                  29                   16                 21   \n",
       "82                  30                   17                 22   \n",
       "83                  31                   18                 23   \n",
       "84                  32                   19                 24   \n",
       "85                  33                   20                 25   \n",
       "86                  34                   21                 26   \n",
       "87                  35                   22                 27   \n",
       "88                  36                   23                 28   \n",
       "89                  37                   24                 29   \n",
       "90                  38                   25                 30   \n",
       "91                  39                   26                 31   \n",
       "92                  40                   27                 32   \n",
       "\n",
       "    days_since_10fatal  days_since_100fatal  \n",
       "70                   0                    0  \n",
       "71                   0                    0  \n",
       "72                   0                    0  \n",
       "73                   0                    0  \n",
       "74                   0                    0  \n",
       "75                   0                    0  \n",
       "76                   0                    0  \n",
       "77                   0                    0  \n",
       "78                   0                    0  \n",
       "79                   0                    0  \n",
       "80                   0                    0  \n",
       "81                   0                    0  \n",
       "82                   0                    0  \n",
       "83                   0                    0  \n",
       "84                   0                    0  \n",
       "85                   0                    0  \n",
       "86                   0                    0  \n",
       "87                   0                    0  \n",
       "88                   0                    0  \n",
       "89                   0                    0  \n",
       "90                   0                    0  \n",
       "91                   0                    0  \n",
       "92                   0                    0  "
      ]
     },
     "execution_count": 213,
     "metadata": {},
     "output_type": "execute_result"
    }
   ],
   "source": [
    "df_interest[df_interest[\"day\"]>91]"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": null,
   "metadata": {},
   "outputs": [],
   "source": []
  },
  {
   "cell_type": "code",
   "execution_count": null,
   "metadata": {},
   "outputs": [],
   "source": []
  },
  {
   "cell_type": "code",
   "execution_count": null,
   "metadata": {},
   "outputs": [],
   "source": []
  },
  {
   "cell_type": "code",
   "execution_count": null,
   "metadata": {},
   "outputs": [],
   "source": []
  },
  {
   "cell_type": "code",
   "execution_count": null,
   "metadata": {},
   "outputs": [],
   "source": []
  },
  {
   "cell_type": "code",
   "execution_count": null,
   "metadata": {},
   "outputs": [],
   "source": []
  },
  {
   "cell_type": "code",
   "execution_count": null,
   "metadata": {},
   "outputs": [],
   "source": []
  },
  {
   "cell_type": "code",
   "execution_count": null,
   "metadata": {},
   "outputs": [],
   "source": []
  },
  {
   "cell_type": "code",
   "execution_count": null,
   "metadata": {},
   "outputs": [],
   "source": []
  },
  {
   "cell_type": "code",
   "execution_count": null,
   "metadata": {},
   "outputs": [],
   "source": []
  },
  {
   "cell_type": "code",
   "execution_count": null,
   "metadata": {},
   "outputs": [],
   "source": []
  },
  {
   "cell_type": "code",
   "execution_count": null,
   "metadata": {},
   "outputs": [],
   "source": []
  },
  {
   "cell_type": "code",
   "execution_count": 177,
   "metadata": {},
   "outputs": [],
   "source": [
    "##################还是伊朗兄弟"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 145,
   "metadata": {},
   "outputs": [
    {
     "name": "stdout",
     "output_type": "stream",
     "text": [
      "len train: 63, len prediction: 30\n"
     ]
    },
    {
     "name": "stderr",
     "output_type": "stream",
     "text": [
      "F:\\Anaconda\\lib\\site-packages\\ipykernel_launcher.py:10: SettingWithCopyWarning: \n",
      "A value is trying to be set on a copy of a slice from a DataFrame\n",
      "\n",
      "See the caveats in the documentation: https://pandas.pydata.org/pandas-docs/stable/user_guide/indexing.html#returning-a-view-versus-a-copy\n",
      "  # Remove the CWD from sys.path while we load stuff.\n",
      "F:\\Anaconda\\lib\\site-packages\\ipykernel_launcher.py:11: SettingWithCopyWarning: \n",
      "A value is trying to be set on a copy of a slice from a DataFrame\n",
      "\n",
      "See the caveats in the documentation: https://pandas.pydata.org/pandas-docs/stable/user_guide/indexing.html#returning-a-view-versus-a-copy\n",
      "  # This is added back by InteractiveShellApp.init_path()\n",
      "F:\\Anaconda\\lib\\site-packages\\ipykernel_launcher.py:20: SettingWithCopyWarning: \n",
      "A value is trying to be set on a copy of a slice from a DataFrame\n",
      "\n",
      "See the caveats in the documentation: https://pandas.pydata.org/pandas-docs/stable/user_guide/indexing.html#returning-a-view-versus-a-copy\n",
      "F:\\Anaconda\\lib\\site-packages\\ipykernel_launcher.py:21: SettingWithCopyWarning: \n",
      "A value is trying to be set on a copy of a slice from a DataFrame\n",
      "\n",
      "See the caveats in the documentation: https://pandas.pydata.org/pandas-docs/stable/user_guide/indexing.html#returning-a-view-versus-a-copy\n",
      "F:\\Anaconda\\lib\\site-packages\\lightgbm\\basic.py:497: UserWarning: Converting data to scipy sparse matrix.\n",
      "  warnings.warn('Converting data to scipy sparse matrix.')\n",
      "F:\\Anaconda\\lib\\site-packages\\ipykernel_launcher.py:32: SettingWithCopyWarning: \n",
      "A value is trying to be set on a copy of a slice from a DataFrame\n",
      "\n",
      "See the caveats in the documentation: https://pandas.pydata.org/pandas-docs/stable/user_guide/indexing.html#returning-a-view-versus-a-copy\n",
      "F:\\Anaconda\\lib\\site-packages\\ipykernel_launcher.py:33: SettingWithCopyWarning: \n",
      "A value is trying to be set on a copy of a slice from a DataFrame\n",
      "\n",
      "See the caveats in the documentation: https://pandas.pydata.org/pandas-docs/stable/user_guide/indexing.html#returning-a-view-versus-a-copy\n",
      "F:\\Anaconda\\lib\\site-packages\\ipykernel_launcher.py:34: SettingWithCopyWarning: \n",
      "A value is trying to be set on a copy of a slice from a DataFrame\n",
      "\n",
      "See the caveats in the documentation: https://pandas.pydata.org/pandas-docs/stable/user_guide/indexing.html#returning-a-view-versus-a-copy\n",
      "F:\\Anaconda\\lib\\site-packages\\ipykernel_launcher.py:35: SettingWithCopyWarning: \n",
      "A value is trying to be set on a copy of a slice from a DataFrame\n",
      "\n",
      "See the caveats in the documentation: https://pandas.pydata.org/pandas-docs/stable/user_guide/indexing.html#returning-a-view-versus-a-copy\n",
      "F:\\Anaconda\\lib\\site-packages\\ipykernel_launcher.py:6: SettingWithCopyWarning: \n",
      "A value is trying to be set on a copy of a slice from a DataFrame\n",
      "\n",
      "See the caveats in the documentation: https://pandas.pydata.org/pandas-docs/stable/user_guide/indexing.html#returning-a-view-versus-a-copy\n",
      "  \n",
      "F:\\Anaconda\\lib\\site-packages\\ipykernel_launcher.py:7: SettingWithCopyWarning: \n",
      "A value is trying to be set on a copy of a slice from a DataFrame\n",
      "\n",
      "See the caveats in the documentation: https://pandas.pydata.org/pandas-docs/stable/user_guide/indexing.html#returning-a-view-versus-a-copy\n",
      "  import sys\n"
     ]
    },
    {
     "name": "stdout",
     "output_type": "stream",
     "text": [
      "63 [ 0.  0.  0.  0.  0.  0.  0.  0.  0.  0.  0.  0.  0.  0.  0.  0.  0.  0.\n",
      "  0.  0.  0.  0.  0.  0.  0.  0.  0.  0.  0.  0.  0.  0.  0.  0.  0.  0.\n",
      "  0.  0.  0.  0.  0.  0.  0.  0.  0.  0.  0.  0.  0.  1.  1.  4.  5.  5.\n",
      "  5.  5. 19. 25. 32. 38. 48. 49. 55.]\n",
      "Indonesia\n"
     ]
    },
    {
     "data": {
      "image/png": "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\n",
      "text/plain": [
       "<Figure size 432x288 with 1 Axes>"
      ]
     },
     "metadata": {
      "needs_background": "light"
     },
     "output_type": "display_data"
    }
   ],
   "source": [
    "place = 'Bhutan'\n",
    "place = places[np.random.randint(len(places))]\n",
    "# place = 'Iran'\n",
    "df_interest_base = df_traintest10[df_traintest10['place_id']==place].reset_index(drop=True)\n",
    "df_interest = copy.deepcopy(df_interest_base)\n",
    "df_interest['ConfirmedCases'] = df_interest['ConfirmedCases'].astype(np.float)\n",
    "df_interest['cases/day'] = df_interest['cases/day'].astype(np.float)\n",
    "df_interest['fatal/day'] = df_interest['fatal/day'].astype(np.float)\n",
    "df_interest['Fatalities'] = df_interest['Fatalities'].astype(np.float)\n",
    "df_interest['cases/day'][df_interest['day']>last_day_train] = -1\n",
    "df_interest['fatal/day'][df_interest['day']>last_day_train] = -1\n",
    "###################标记训练与预测数据\n",
    "len_known = (df_interest['cases/day']!=-1).sum()\n",
    "len_unknown = (df_interest['cases/day']==-1).sum()\n",
    "print(\"len train: {}, len prediction: {}\".format(len_known, len_unknown))\n",
    "X_valid = df_interest[col_var][df_interest['day']>84]\n",
    "X_valid2 = df_interest[col_var2][df_interest['day']>84]\n",
    "pred_f =  np.exp(model.predict(X_valid))-1\n",
    "pred_c = np.exp(model2.predict(X_valid2))-1\n",
    "df_interest['fatal/day'][df_interest['day']>last_day_train] = pred_f.clip(0, 1e10)\n",
    "df_interest['cases/day'][df_interest['day']>last_day_train] = pred_c.clip(0, 1e10)\n",
    "########累计确诊是每日确诊相加\n",
    "df_interest['Fatalities'] = np.cumsum(df_interest['fatal/day'].values)\n",
    "df_interest['ConfirmedCases'] = np.cumsum(df_interest['cases/day'].values)\n",
    "for j in range(len_unknown): # use predicted cases and fatal for next days' prediction\n",
    "    X_valid = df_interest[col_var].iloc[j+len_known]\n",
    "    X_valid2 = df_interest[col_var2].iloc[j+len_known]\n",
    "    pred_f = model_pri.predict(X_valid)\n",
    "    pred_c = model2_pri.predict(X_valid2)\n",
    "    pred_c = (np.exp(pred_c)-1).clip(0, 1e10)\n",
    "    pred_f = (np.exp(pred_f)-1).clip(0, 1e10)\n",
    "    df_interest['fatal/day'][j+len_known] = pred_f\n",
    "    df_interest['cases/day'][j+len_known] = pred_c\n",
    "    df_interest['Fatalities'][j+len_known] = df_interest['Fatalities'][j+len_known-1] + pred_f\n",
    "    df_interest['ConfirmedCases'][j+len_known] = df_interest['ConfirmedCases'][j+len_known-1] + pred_c\n",
    "    df_interest = df_interest.drop([\n",
    "        'cases/day-(1-1)', 'cases/day-(1-7)', 'cases/day-(8-14)', 'cases/day-(15-21)', \n",
    "        'fatal/day-(1-1)', 'fatal/day-(1-7)', 'fatal/day-(8-14)', 'fatal/day-(15-21)', \n",
    "        'days_since_1cases', 'days_since_10cases', 'days_since_100cases',\n",
    "        'days_since_1fatal', 'days_since_10fatal', 'days_since_100fatal',\n",
    "                                   \n",
    "                                   ],  axis=1)\n",
    "    df_interest = do_aggregations(df_interest.reset_index(drop=True))\n",
    "\n",
    "# visualize\n",
    "tmp = df_interest['fatal/day'].values\n",
    "tmp = np.cumsum(tmp)\n",
    "sns.lineplot(x=df_interest_base['day'], y=tmp, label='pred')\n",
    "tmp = df_traintest10['Fatalities'][(df_traintest10['place_id']==place)& (pd.isna(df_traintest10['ForecastId']))].values\n",
    "print(len(tmp), tmp)\n",
    "sns.lineplot(x=df_traintest10['day'][(df_traintest10['place_id']==place)& (pd.isna(df_traintest10['ForecastId']))].values,\n",
    "             y=tmp, label='true')\n",
    "print(place)\n",
    "plt.show()"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 179,
   "metadata": {},
   "outputs": [],
   "source": [
    "###################训练集合当然拟合好了\n",
    "################我们把全部数据给了决策树啊\n",
    "#################之后呢？不知道，给kaggle判个分吧"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 180,
   "metadata": {},
   "outputs": [],
   "source": [
    "##########################就这样吧，每个人都跑一遍然后提交，提交格式参考其他选手，或者日本友人"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": null,
   "metadata": {},
   "outputs": [],
   "source": [
    "#################下面是之前的老笔记"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": null,
   "metadata": {},
   "outputs": [],
   "source": []
  },
  {
   "cell_type": "code",
   "execution_count": null,
   "metadata": {},
   "outputs": [],
   "source": []
  },
  {
   "cell_type": "code",
   "execution_count": null,
   "metadata": {},
   "outputs": [],
   "source": []
  },
  {
   "cell_type": "code",
   "execution_count": null,
   "metadata": {},
   "outputs": [],
   "source": []
  },
  {
   "cell_type": "code",
   "execution_count": null,
   "metadata": {},
   "outputs": [],
   "source": []
  },
  {
   "cell_type": "code",
   "execution_count": null,
   "metadata": {},
   "outputs": [],
   "source": []
  },
  {
   "cell_type": "code",
   "execution_count": null,
   "metadata": {},
   "outputs": [],
   "source": []
  },
  {
   "cell_type": "code",
   "execution_count": null,
   "metadata": {},
   "outputs": [],
   "source": []
  },
  {
   "cell_type": "code",
   "execution_count": null,
   "metadata": {},
   "outputs": [],
   "source": []
  },
  {
   "cell_type": "code",
   "execution_count": null,
   "metadata": {},
   "outputs": [],
   "source": []
  },
  {
   "cell_type": "code",
   "execution_count": null,
   "metadata": {},
   "outputs": [],
   "source": []
  },
  {
   "cell_type": "code",
   "execution_count": null,
   "metadata": {},
   "outputs": [],
   "source": []
  },
  {
   "cell_type": "code",
   "execution_count": null,
   "metadata": {},
   "outputs": [],
   "source": []
  },
  {
   "cell_type": "code",
   "execution_count": null,
   "metadata": {},
   "outputs": [],
   "source": []
  },
  {
   "cell_type": "code",
   "execution_count": null,
   "metadata": {},
   "outputs": [],
   "source": []
  },
  {
   "cell_type": "code",
   "execution_count": null,
   "metadata": {},
   "outputs": [],
   "source": []
  },
  {
   "cell_type": "code",
   "execution_count": null,
   "metadata": {},
   "outputs": [],
   "source": []
  },
  {
   "cell_type": "code",
   "execution_count": null,
   "metadata": {},
   "outputs": [],
   "source": []
  },
  {
   "cell_type": "code",
   "execution_count": null,
   "metadata": {},
   "outputs": [],
   "source": []
  },
  {
   "cell_type": "code",
   "execution_count": null,
   "metadata": {},
   "outputs": [],
   "source": []
  },
  {
   "cell_type": "code",
   "execution_count": null,
   "metadata": {},
   "outputs": [],
   "source": []
  },
  {
   "cell_type": "code",
   "execution_count": null,
   "metadata": {},
   "outputs": [],
   "source": []
  },
  {
   "cell_type": "code",
   "execution_count": null,
   "metadata": {},
   "outputs": [],
   "source": []
  },
  {
   "cell_type": "code",
   "execution_count": null,
   "metadata": {},
   "outputs": [],
   "source": []
  },
  {
   "cell_type": "code",
   "execution_count": null,
   "metadata": {},
   "outputs": [],
   "source": [
    "####################提交过程，参考其他选手，需要维持原来的格式"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": null,
   "metadata": {},
   "outputs": [],
   "source": [
    "#################下面是之前的老笔记"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": null,
   "metadata": {},
   "outputs": [],
   "source": []
  },
  {
   "cell_type": "code",
   "execution_count": null,
   "metadata": {},
   "outputs": [],
   "source": []
  },
  {
   "cell_type": "code",
   "execution_count": null,
   "metadata": {},
   "outputs": [],
   "source": []
  },
  {
   "cell_type": "code",
   "execution_count": null,
   "metadata": {},
   "outputs": [],
   "source": []
  },
  {
   "cell_type": "code",
   "execution_count": null,
   "metadata": {},
   "outputs": [],
   "source": []
  },
  {
   "cell_type": "code",
   "execution_count": null,
   "metadata": {},
   "outputs": [],
   "source": []
  },
  {
   "cell_type": "code",
   "execution_count": null,
   "metadata": {},
   "outputs": [],
   "source": []
  },
  {
   "cell_type": "code",
   "execution_count": null,
   "metadata": {},
   "outputs": [],
   "source": []
  },
  {
   "cell_type": "code",
   "execution_count": null,
   "metadata": {},
   "outputs": [],
   "source": []
  },
  {
   "cell_type": "code",
   "execution_count": null,
   "metadata": {},
   "outputs": [],
   "source": []
  },
  {
   "cell_type": "code",
   "execution_count": null,
   "metadata": {},
   "outputs": [],
   "source": []
  },
  {
   "cell_type": "code",
   "execution_count": null,
   "metadata": {},
   "outputs": [],
   "source": []
  },
  {
   "cell_type": "code",
   "execution_count": null,
   "metadata": {},
   "outputs": [],
   "source": []
  },
  {
   "cell_type": "code",
   "execution_count": null,
   "metadata": {},
   "outputs": [],
   "source": []
  },
  {
   "cell_type": "code",
   "execution_count": null,
   "metadata": {},
   "outputs": [],
   "source": []
  },
  {
   "cell_type": "code",
   "execution_count": 153,
   "metadata": {},
   "outputs": [],
   "source": [
    "###############每个人都提交一次"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": null,
   "metadata": {},
   "outputs": [],
   "source": [
    "#########################之后不用看了,不需要"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": null,
   "metadata": {},
   "outputs": [],
   "source": [
    "#################################之后是向kaggle提交的过程"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": null,
   "metadata": {},
   "outputs": [],
   "source": [
    "# predict test data in public\n",
    "day_before_public = 71\n",
    "df_preds = []\n",
    "for i, place in enumerate(places[:]):\n",
    "#     if place!='Japan' and place!='Afghanistan' :continue\n",
    "    df_interest = copy.deepcopy(df_traintest9[df_traintest9['place_id']==place].reset_index(drop=True))\n",
    "    df_interest['cases/day'][(pd.isna(df_interest['ForecastId']))==False] = -1\n",
    "    df_interest['fatal/day'][(pd.isna(df_interest['ForecastId']))==False] = -1\n",
    "    len_known = (df_interest['day']<=day_before_public).sum()\n",
    "    len_unknown = (day_before_public<df_interest['day']).sum()\n",
    "    for j in range(len_unknown): # use predicted cases and fatal for next days' prediction\n",
    "        X_valid = df_interest[col_var].iloc[j+len_known]\n",
    "        X_valid2 = df_interest[col_var2].iloc[j+len_known]\n",
    "        pred_f = model.predict(X_valid)\n",
    "        pred_c = model2.predict(X_valid2)\n",
    "        pred_c = (np.exp(pred_c)-1).clip(0, 1e10)\n",
    "        pred_f = (np.exp(pred_f)-1).clip(0, 1e10)\n",
    "        df_interest['fatal/day'][j+len_known] = pred_f\n",
    "        df_interest['cases/day'][j+len_known] = pred_c\n",
    "        df_interest['Fatalities'][j+len_known] = df_interest['Fatalities'][j+len_known-1] + pred_f\n",
    "        df_interest['ConfirmedCases'][j+len_known] = df_interest['ConfirmedCases'][j+len_known-1] + pred_c\n",
    "        df_interest = df_interest.drop([\n",
    "            'cases/day-(1-1)', 'cases/day-(1-7)', 'cases/day-(8-14)', 'cases/day-(15-21)', \n",
    "            'fatal/day-(1-1)', 'fatal/day-(1-7)', 'fatal/day-(8-14)', 'fatal/day-(15-21)',\n",
    "            'days_since_1cases', 'days_since_10cases', 'days_since_100cases',\n",
    "            'days_since_1fatal', 'days_since_10fatal', 'days_since_100fatal',\n",
    "                    ],  axis=1)\n",
    "        df_interest = do_aggregations(df_interest)\n",
    "    if (i+1)%10==0:\n",
    "        print(\"{:3d}/{}  {}, len known: {}, len unknown: {}\".format(i+1, len(places), place, len_known, len_unknown), df_interest.shape)\n",
    "    df_interest['fatal_pred'] = np.cumsum(df_interest['fatal/day'].values)\n",
    "    df_interest['cases_pred'] = np.cumsum(df_interest['cases/day'].values)\n",
    "    df_preds.append(df_interest)"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": null,
   "metadata": {},
   "outputs": [],
   "source": [
    "df_preds= pd.concat(df_preds)\n",
    "df_preds = df_preds.sort_values('day')\n",
    "col_tmp = ['place_id', 'ForecastId', 'day', 'cases/day', 'cases_pred', 'fatal/day', 'fatal_pred',]\n",
    "df_preds[col_tmp][(df_preds['place_id']=='Afghanistan') & (df_preds['day']>75)].head(10)"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": null,
   "metadata": {},
   "outputs": [],
   "source": [
    "df_preds.to_csv(\"submission.csv\", index=None)"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": null,
   "metadata": {},
   "outputs": [],
   "source": []
  },
  {
   "cell_type": "code",
   "execution_count": null,
   "metadata": {},
   "outputs": [],
   "source": []
  },
  {
   "cell_type": "code",
   "execution_count": null,
   "metadata": {},
   "outputs": [],
   "source": []
  },
  {
   "cell_type": "code",
   "execution_count": null,
   "metadata": {},
   "outputs": [],
   "source": []
  },
  {
   "cell_type": "code",
   "execution_count": null,
   "metadata": {},
   "outputs": [],
   "source": []
  },
  {
   "cell_type": "code",
   "execution_count": null,
   "metadata": {},
   "outputs": [],
   "source": []
  },
  {
   "cell_type": "code",
   "execution_count": null,
   "metadata": {},
   "outputs": [],
   "source": [
    "import seaborn as sns\n",
    "import matplotlib.pyplot as plt"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": null,
   "metadata": {},
   "outputs": [],
   "source": [
    "# Check the predictions of of Cases Public\n",
    "place = 'Bhutan'\n",
    "# place = places[np.random.randint(len(places))]\n",
    "# place = 'Iran'\n",
    "df_interest_base = df_traintest9[df_traintest9['place_id']==place].reset_index(drop=True)\n",
    "print(df_traintest9[df_traintest9['place_id']==place])\n",
    "df_interest = copy.deepcopy(df_interest_base)\n",
    "df_interest['ConfirmedCases'] = df_interest['ConfirmedCases'].astype(np.float)\n",
    "df_interest['cases/day'] = df_interest['cases/day'].astype(np.float)\n",
    "df_interest['fatal/day'] = df_interest['fatal/day'].astype(np.float)\n",
    "df_interest['Fatalities'] = df_interest['Fatalities'].astype(np.float)\n",
    "df_interest['cases/day'][df_interest['day']>=72] = -1\n",
    "df_interest['fatal/day'][df_interest['day']>=72] = -1\n",
    "len_known = (df_interest['cases/day']!=-1).sum()\n",
    "len_unknown = (df_interest['cases/day']==-1).sum()\n",
    "print(\"len train: {}, len prediction: {}\".format(len_known, len_unknown))\n",
    "X_valid = df_interest[col_var][df_interest['day']>=72]\n",
    "X_valid2 = df_interest[col_var2][df_interest['day']>=72]\n",
    "pred_f =  np.exp(model.predict(X_valid))-1\n",
    "pred_c = np.exp(model2.predict(X_valid2))-1\n",
    "df_interest['fatal/day'][df_interest['day']>=72] = pred_f.clip(0, 1e10)\n",
    "df_interest['cases/day'][df_interest['day']>=72] = pred_c.clip(0, 1e10)\n",
    "df_interest['Fatalities'] = np.cumsum(df_interest['fatal/day'].values)\n",
    "df_interest['ConfirmedCases'] = np.cumsum(df_interest['cases/day'].values)\n",
    "for j in range(len_unknown): # use predicted cases and fatal for next days' prediction\n",
    "    X_valid = df_interest[col_var].iloc[j+len_known]\n",
    "    X_valid2 = df_interest[col_var2].iloc[j+len_known]\n",
    "    pred_f = model.predict(X_valid)\n",
    "    pred_c = model2.predict(X_valid2)\n",
    "    pred_c = (np.exp(pred_c)-1).clip(0, 1e10)\n",
    "    pred_f = (np.exp(pred_f)-1).clip(0, 1e10)\n",
    "    df_interest['fatal/day'][j+len_known] = pred_f\n",
    "    df_interest['cases/day'][j+len_known] = pred_c\n",
    "    df_interest['Fatalities'][j+len_known] = df_interest['Fatalities'][j+len_known-1] + pred_f\n",
    "    df_interest['ConfirmedCases'][j+len_known] = df_interest['ConfirmedCases'][j+len_known-1] + pred_c\n",
    "    df_interest = df_interest.drop([\n",
    "        'cases/day_(1-1)', 'cases/day_(1-7)', 'cases/day_(8-14)', 'cases/day_(15-21)', \n",
    "        'fatal/day_(1-1)', 'fatal/day_(1-7)', 'fatal/day_(8-14)', 'fatal/day_(15-21)', \n",
    "        'days_since_1cases', 'days_since_10cases', 'days_since_100cases',\n",
    "        'days_since_1fatal', 'days_since_10fatal', 'days_since_100fatal',\n",
    "                                   \n",
    "                                   ],  axis=1)\n",
    "    df_interest = do_aggregations(df_interest.reset_index(drop=True))\n",
    "\n",
    "# visualize\n",
    "tmp = df_interest['cases/day'].values\n",
    "print(tmp)\n",
    "tmp = np.cumsum(tmp)\n",
    "# print(tmp)\n",
    "sns.lineplot(x=df_interest_base['day'], y=tmp, label='pred')\n",
    "tmp = df_traintest8['ConfirmedCases'][(df_traintest8['place_id']==place)& (pd.isna(df_traintest8['ForecastId']))].values\n",
    "print(len(tmp), tmp)\n",
    "sns.lineplot(x=df_traintest8['day'][(df_traintest8['place_id']==place)& (pd.isna(df_traintest8['ForecastId']))].values,\n",
    "             y=tmp, label='true')\n",
    "print(place)\n",
    "plt.show()"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": null,
   "metadata": {},
   "outputs": [],
   "source": [
    "# Check the predictions of of Cases Public\n",
    "place = 'Bhutan'\n",
    "# place = places[np.random.randint(len(places))]\n",
    "# place = 'Iran'\n",
    "df_interest_base = df_traintest9[df_traintest9['place_id']==place].reset_index(drop=True)\n",
    "print(df_traintest9[df_traintest9['place_id']==place])\n",
    "df_interest = copy.deepcopy(df_interest_base)\n",
    "df_interest['ConfirmedCases'] = df_interest['ConfirmedCases'].astype(np.float)\n",
    "df_interest['cases/day'] = df_interest['cases/day'].astype(np.float)\n",
    "df_interest['fatal/day'] = df_interest['fatal/day'].astype(np.float)\n",
    "df_interest['Fatalities'] = df_interest['Fatalities'].astype(np.float)\n",
    "df_interest['cases/day'][df_interest['day']>=72] = -1\n",
    "df_interest['fatal/day'][df_interest['day']>=72] = -1\n",
    "len_known = (df_interest['cases/day']!=-1).sum()\n",
    "len_unknown = (df_interest['cases/day']==-1).sum()\n",
    "print(\"len train: {}, len prediction: {}\".format(len_known, len_unknown))\n",
    "X_valid = df_interest[col_var][df_interest['day']>=72]\n",
    "X_valid2 = df_interest[col_var2][df_interest['day']>=72]\n",
    "pred_f =  np.exp(model.predict(X_valid))-1\n",
    "pred_c = np.exp(model2.predict(X_valid2))-1\n",
    "df_interest['fatal/day'][df_interest['day']>=72] = pred_f.clip(0, 1e10)\n",
    "df_interest['cases/day'][df_interest['day']>=72] = pred_c.clip(0, 1e10)\n",
    "df_interest['Fatalities'] = np.cumsum(df_interest['fatal/day'].values)\n",
    "df_interest['ConfirmedCases'] = np.cumsum(df_interest['cases/day'].values)\n",
    "for j in range(len_unknown): # use predicted cases and fatal for next days' prediction\n",
    "    X_valid = df_interest[col_var].iloc[j+len_known]\n",
    "    X_valid2 = df_interest[col_var2].iloc[j+len_known]\n",
    "    pred_f = model.predict(X_valid)\n",
    "    pred_c = model2.predict(X_valid2)\n",
    "    pred_c = (np.exp(pred_c)-1).clip(0, 1e10)\n",
    "    pred_f = (np.exp(pred_f)-1).clip(0, 1e10)\n",
    "    df_interest['fatal/day'][j+len_known] = pred_f\n",
    "    df_interest['cases/day'][j+len_known] = pred_c\n",
    "    df_interest['Fatalities'][j+len_known] = df_interest['Fatalities'][j+len_known-1] + pred_f\n",
    "    df_interest['ConfirmedCases'][j+len_known] = df_interest['ConfirmedCases'][j+len_known-1] + pred_c\n",
    "    df_interest = df_interest.drop([\n",
    "        'cases/day_(1-1)', 'cases/day_(1-7)', 'cases/day_(8-14)', 'cases/day_(15-21)', \n",
    "        'fatal/day_(1-1)', 'fatal/day_(1-7)', 'fatal/day_(8-14)', 'fatal/day_(15-21)', \n",
    "        'days_since_1cases', 'days_since_10cases', 'days_since_100cases',\n",
    "        'days_since_1fatal', 'days_since_10fatal', 'days_since_100fatal',\n",
    "                                   \n",
    "                                   ],  axis=1)\n",
    "    df_interest = do_aggregations(df_interest.reset_index(drop=True))\n",
    "\n",
    "# visualize\n",
    "tmp = df_interest['cases/day'].values\n",
    "print(tmp)\n",
    "tmp = np.cumsum(tmp)\n",
    "# print(tmp)\n",
    "sns.lineplot(x=df_interest_base['day'], y=tmp, label='pred')\n",
    "tmp = df_traintest8['ConfirmedCases'][(df_traintest8['place_id']==place)& (pd.isna(df_traintest8['ForecastId']))].values\n",
    "print(len(tmp), tmp)\n",
    "sns.lineplot(x=df_traintest8['day'][(df_traintest8['place_id']==place)& (pd.isna(df_traintest8['ForecastId']))].values,\n",
    "             y=tmp, label='true')\n",
    "print(place)\n",
    "plt.show()"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": null,
   "metadata": {},
   "outputs": [],
   "source": [
    "# Check the predictions of of Cases Public\n",
    "place = 'Afghanistan'\n",
    "# place = places[np.random.randint(len(places))]\n",
    "# place = 'Iran'\n",
    "df_interest_base = df_traintest9[df_traintest9['place_id']==place].reset_index(drop=True)\n",
    "df_interest = copy.deepcopy(df_interest_base)\n",
    "df_interest['ConfirmedCases'] = df_interest['ConfirmedCases'].astype(np.float)\n",
    "df_interest['cases/day'] = df_interest['cases/day'].astype(np.float)\n",
    "df_interest['fatal/day'] = df_interest['fatal/day'].astype(np.float)\n",
    "df_interest['Fatalities'] = df_interest['Fatalities'].astype(np.float)\n",
    "df_interest['cases/day'][df_interest['day']>=72] = -1\n",
    "df_interest['fatal/day'][df_interest['day']>=72] = -1\n",
    "len_known = (df_interest['cases/day']!=-1).sum()\n",
    "len_unknown = (df_interest['cases/day']==-1).sum()\n",
    "print(\"len train: {}, len prediction: {}\".format(len_known, len_unknown))\n",
    "X_valid = df_interest[col_var][df_interest['day']>=72]\n",
    "X_valid2 = df_interest[col_var2][df_interest['day']>=72]\n",
    "pred_f =  np.exp(model.predict(X_valid))-1\n",
    "pred_c = np.exp(model2.predict(X_valid2))-1\n",
    "df_interest['fatal/day'][df_interest['day']>=72] = pred_f.clip(0, 1e10)\n",
    "df_interest['cases/day'][df_interest['day']>=72] = pred_c.clip(0, 1e10)\n",
    "df_interest['Fatalities'] = np.cumsum(df_interest['fatal/day'].values)\n",
    "df_interest['ConfirmedCases'] = np.cumsum(df_interest['cases/day'].values)\n",
    "for j in range(len_unknown): # use predicted cases and fatal for next days' prediction\n",
    "    X_valid = df_interest[col_var].iloc[j+len_known]\n",
    "    X_valid2 = df_interest[col_var2].iloc[j+len_known]\n",
    "    pred_f = model.predict(X_valid)\n",
    "    pred_c = model2.predict(X_valid2)\n",
    "    pred_c = (np.exp(pred_c)-1).clip(0, 1e10)\n",
    "    pred_f = (np.exp(pred_f)-1).clip(0, 1e10)\n",
    "    df_interest['fatal/day'][j+len_known] = pred_f\n",
    "    df_interest['cases/day'][j+len_known] = pred_c\n",
    "    df_interest['Fatalities'][j+len_known] = df_interest['Fatalities'][j+len_known-1] + pred_f\n",
    "    df_interest['ConfirmedCases'][j+len_known] = df_interest['ConfirmedCases'][j+len_known-1] + pred_c\n",
    "    df_interest = df_interest.drop([\n",
    "        'cases/day-(1-1)', 'cases/day-(1-7)', 'cases/day-(8-14)', 'cases/day-(15-21)', \n",
    "        'fatal/day-(1-1)', 'fatal/day-(1-7)', 'fatal/day-(8-14)', 'fatal/day-(15-21)',],  axis=1)\n",
    "    df_interest = do_aggregations(df_interest.reset_index(drop=True))\n",
    "\n",
    "# visualize\n",
    "tmp = df_interest['cases/day'].values\n",
    "tmp = np.cumsum(tmp)\n",
    "sns.lineplot(x=df_interest_base['day'], y=tmp, label='pred')\n",
    "tmp = df_traintest8['ConfirmedCases'][(df_traintest8['place_id']==place)& (pd.isna(df_traintest8['ForecastId']))].values\n",
    "print(len(tmp), tmp)\n",
    "sns.lineplot(x=df_traintest8['day'][(df_traintest8['place_id']==place)& (pd.isna(df_traintest8['ForecastId']))].values,\n",
    "             y=tmp, label='true')\n",
    "print(place)\n",
    "plt.show()"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": null,
   "metadata": {},
   "outputs": [],
   "source": []
  },
  {
   "cell_type": "code",
   "execution_count": null,
   "metadata": {},
   "outputs": [],
   "source": []
  },
  {
   "cell_type": "code",
   "execution_count": null,
   "metadata": {},
   "outputs": [],
   "source": []
  },
  {
   "cell_type": "code",
   "execution_count": null,
   "metadata": {},
   "outputs": [],
   "source": []
  },
  {
   "cell_type": "code",
   "execution_count": null,
   "metadata": {},
   "outputs": [],
   "source": []
  },
  {
   "cell_type": "code",
   "execution_count": null,
   "metadata": {},
   "outputs": [],
   "source": [
    "col_target2 = 'cases/day'\n",
    "col_var2 = [\n",
    "    'Lat', 'Long',\n",
    "#     'days_since_1cases', \n",
    "    'days_since_10cases', #selected\n",
    "#     'days_since_100cases',\n",
    "#     'days_since_1fatal', \n",
    "#     'days_since_10fatal',\n",
    "#     'days_since_100fatal',\n",
    "#     'days_since_1recov',\n",
    "#     'days_since_10recov', 'days_since_100recov', \n",
    "    'cases/day-(1-1)', \n",
    "    'cases/day-(1-7)', \n",
    "    'cases/day-(8-14)',  \n",
    "    'cases/day-(15-21)', \n",
    "    \n",
    "#     'fatal/day_(1-1)', \n",
    "#     'fatal/day_(1-7)', \n",
    "#     'fatal/day_(8-14)', \n",
    "#     'fatal/day_(15-21)', \n",
    "#     'recov/day_(1-1)', 'recov/day_(1-7)', \n",
    "#     'recov/day_(8-14)',  'recov/day_(15-21)',\n",
    "#     'active_(1-1)', \n",
    "#     'active_(1-7)', \n",
    "#     'active_(8-14)',  'active_(15-21)', \n",
    "#     'SmokingRate',\n",
    "#     'Gross_domestic_product__constant_prices',\n",
    "#     'Gross_domestic_product__current_prices',\n",
    "#     'Gross_domestic_product__deflator',\n",
    "#     'Gross_domestic_product_per_capita__constant_prices',\n",
    "#     'Gross_domestic_product_per_capita__current_prices',\n",
    "#     'Output_gap_in_percent_of_potential_GDP',\n",
    "#     'Gross_domestic_product_based_on_purchasing_power_parity__PPP__valuation_of_country_GDP',\n",
    "#     'Gross_domestic_product_based_on_purchasing_power_parity__PPP__per_capita_GDP',\n",
    "#     'Gross_domestic_product_based_on_purchasing_power_parity__PPP__share_of_world_total',\n",
    "#     'Implied_PPP_conversion_rate', 'Total_investment',\n",
    "#     'Gross_national_savings', 'Inflation__average_consumer_prices',\n",
    "#     'Inflation__end_of_period_consumer_prices',\n",
    "#     'Six_month_London_interbank_offered_rate__LIBOR_',\n",
    "#     'Volume_of_imports_of_goods_and_services', 'Volume_of_Imports_of_goods',\n",
    "#     'Volume_of_exports_of_goods_and_services', 'Volume_of_exports_of_goods',\n",
    "#     'Unemployment_rate', \n",
    "#     'Employment', \n",
    "#     'Population',\n",
    "#     'General_government_revenue', 'General_government_total_expenditure',\n",
    "#     'General_government_net_lending_borrowing',\n",
    "#     'General_government_structural_balance',\n",
    "#     'General_government_primary_net_lending_borrowing',\n",
    "#     'General_government_net_debt', 'General_government_gross_debt',\n",
    "#     'Gross_domestic_product_corresponding_to_fiscal_year__current_prices',\n",
    "#     'Current_account_balance', \n",
    "#     'LifeExpectancy',\n",
    "#     'pop',\n",
    "#     'density', \n",
    "#     'medianage', \n",
    "#     'urbanpop', \n",
    "#     'hospibed', 'smokers', \n",
    "]\n",
    "col_cat = []\n",
    "df_train = df_traintest8[(pd.isna(df_traintest8['ForecastId'])) & (df_traintest8['day']<61)]\n",
    "df_valid = df_traintest8[(pd.isna(df_traintest8['ForecastId'])) & (df_traintest8['day']>=61) & (df_traintest8['day']<72)]\n",
    "# df_valid = df_traintest8[(pd.isna(df_traintest8['ForecastId'])) & (df_traintest8['day']>=61)]\n",
    "df_test = df_traintest8[pd.isna(df_traintest8['ForecastId'])==False]\n",
    "X_train = df_train[col_var2]\n",
    "X_valid = df_valid[col_var2]\n",
    "y_train = np.log(df_train[col_target2].values.clip(0, 1e10)+1)\n",
    "y_valid = np.log(df_valid[col_target2].values.clip(0, 1e10)+1)\n",
    "train_data = lgb.Dataset(X_train, label=y_train, categorical_feature=col_cat)\n",
    "valid_data = lgb.Dataset(X_valid, label=y_valid, categorical_feature=col_cat)\n",
    "model2 = lgb.train(params, train_data, num_round, valid_sets=[train_data, valid_data],\n",
    "                  verbose_eval=100,\n",
    "                  early_stopping_rounds=150,)\n",
    "best_itr = model2.best_iteration"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": null,
   "metadata": {},
   "outputs": [],
   "source": [
    "y_true = df_valid['cases/day'].values\n",
    "y_pred = np.exp(model2.predict(X_valid))-1\n",
    "score = calc_score(y_true, y_pred)\n",
    "print(\"{:.6f}\".format(score))            ##################这就不是很好的结果了"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": null,
   "metadata": {},
   "outputs": [],
   "source": [
    "#####################同理，最后在整个集合上观察结果"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": null,
   "metadata": {},
   "outputs": [],
   "source": [
    "df_train = df_traintest8[(pd.isna(df_traintest8['ForecastId'])) & (df_traintest8['day']<72)]\n",
    "df_valid = df_traintest8[(pd.isna(df_traintest8['ForecastId'])) & (df_traintest8['day']<72)]\n",
    "# df_valid = df_traintest8[(pd.isna(df_traintest8['ForecastId'])) & (df_traintest8['day']>=61)]\n",
    "df_test = df_traintest8[pd.isna(df_traintest8['ForecastId'])==False]\n",
    "X_train = df_train[col_var2]\n",
    "X_valid = df_valid[col_var2]\n",
    "y_train = np.log(df_train[col_target2].values.clip(0, 1e10)+1)\n",
    "y_valid = np.log(df_valid[col_target2].values.clip(0, 1e10)+1)\n",
    "train_data = lgb.Dataset(X_train, label=y_train, categorical_feature=col_cat)\n",
    "valid_data = lgb.Dataset(X_valid, label=y_valid, categorical_feature=col_cat)\n",
    "model2 = lgb.train(params, train_data, best_itr, valid_sets=[train_data, valid_data],\n",
    "                  verbose_eval=100,\n",
    "                  early_stopping_rounds=150,)"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": null,
   "metadata": {},
   "outputs": [],
   "source": [
    "#################改变训练集测试集？为什么要改变？还要想想\n",
    "#################为什么引入了之后的步骤啊，可能要结合下面数据可视化的部分才知道，都是和上面一样冗余的过程\n",
    "#################大概的意思就是：改变训练集测试集数据的范围？因为有部分地区有足够多的日期数据"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": null,
   "metadata": {},
   "outputs": [],
   "source": [
    "# train model to predict fatalities/day\n",
    "df_train = df_traintest8[(pd.isna(df_traintest8['ForecastId'])) & (df_traintest8['day']<72)]\n",
    "df_valid = df_traintest8[(pd.isna(df_traintest8['ForecastId'])) & (df_traintest8['day']>=72)]\n",
    "df_test = df_traintest8[pd.isna(df_traintest8['ForecastId'])==False]\n",
    "X_train = df_train[col_var]\n",
    "X_valid = df_valid[col_var]\n",
    "y_train = np.log(df_train[col_target].values.clip(0, 1e10)+1)\n",
    "y_valid = np.log(df_valid[col_target].values.clip(0, 1e10)+1)\n",
    "train_data = lgb.Dataset(X_train, label=y_train, categorical_feature=col_cat)\n",
    "valid_data = lgb.Dataset(X_valid, label=y_valid, categorical_feature=col_cat)\n",
    "model_pri = lgb.train(params, train_data, num_round, valid_sets=[train_data, valid_data],\n",
    "                  verbose_eval=100,\n",
    "                  early_stopping_rounds=150,)\n",
    "best_itr = model_pri.best_iteration"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": null,
   "metadata": {},
   "outputs": [],
   "source": [
    "df_train = df_traintest8[(pd.isna(df_traintest8['ForecastId']))]\n",
    "df_valid = df_traintest8[(pd.isna(df_traintest8['ForecastId']))]\n",
    "# df_valid = df_traintest8[(pd.isna(df_traintest8['ForecastId'])) & (df_traintest8['day']>=61)]\n",
    "df_test = df_traintest8[pd.isna(df_traintest8['ForecastId'])==False]\n",
    "X_train = df_train[col_var]\n",
    "X_valid = df_valid[col_var]\n",
    "y_train = np.log(df_train[col_target].values.clip(0, 1e10)+1)\n",
    "y_valid = np.log(df_valid[col_target].values.clip(0, 1e10)+1)\n",
    "train_data = lgb.Dataset(X_train, label=y_train, categorical_feature=col_cat)\n",
    "valid_data = lgb.Dataset(X_valid, label=y_valid, categorical_feature=col_cat)\n",
    "model_pri = lgb.train(params, train_data, best_itr, valid_sets=[train_data, valid_data],\n",
    "                  verbose_eval=100,\n",
    "                  early_stopping_rounds=150,)"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": null,
   "metadata": {},
   "outputs": [],
   "source": [
    "# train model to predict fatalities/day\n",
    "df_train = df_traintest8[(pd.isna(df_traintest8['ForecastId'])) & (df_traintest8['day']<72)]\n",
    "df_valid = df_traintest8[(pd.isna(df_traintest8['ForecastId'])) & (df_traintest8['day']>=72)]\n",
    "# df_valid = df_traintest8[(pd.isna(df_traintest8['ForecastId'])) & (df_traintest8['day']>=61)]\n",
    "df_test = df_traintest8[pd.isna(df_traintest8['ForecastId'])==False]\n",
    "X_train = df_train[col_var2]\n",
    "X_valid = df_valid[col_var2]\n",
    "y_train = np.log(df_train[col_target2].values.clip(0, 1e10)+1)\n",
    "y_valid = np.log(df_valid[col_target2].values.clip(0, 1e10)+1)\n",
    "train_data = lgb.Dataset(X_train, label=y_train, categorical_feature=col_cat)\n",
    "valid_data = lgb.Dataset(X_valid, label=y_valid, categorical_feature=col_cat)\n",
    "model2_pri = lgb.train(params, train_data, num_round, valid_sets=[train_data, valid_data],\n",
    "                  verbose_eval=100,\n",
    "                  early_stopping_rounds=150,)\n",
    "best_itr = model2_pri.best_iteration"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": null,
   "metadata": {},
   "outputs": [],
   "source": [
    "df_train = df_traintest8[(pd.isna(df_traintest8['ForecastId']))]\n",
    "df_valid = df_traintest8[(pd.isna(df_traintest8['ForecastId']))]\n",
    "# df_valid = df_traintest8[(pd.isna(df_traintest8['ForecastId'])) & (df_traintest8['day']>=61)]\n",
    "df_test = df_traintest8[pd.isna(df_traintest8['ForecastId'])==False]\n",
    "X_train = df_train[col_var2]\n",
    "X_valid = df_valid[col_var2]\n",
    "y_train = np.log(df_train[col_target2].values.clip(0, 1e10)+1)\n",
    "y_valid = np.log(df_valid[col_target2].values.clip(0, 1e10)+1)\n",
    "train_data = lgb.Dataset(X_train, label=y_train, categorical_feature=col_cat)\n",
    "valid_data = lgb.Dataset(X_valid, label=y_valid, categorical_feature=col_cat)\n",
    "model2_pri = lgb.train(params, train_data, best_itr, valid_sets=[train_data, valid_data],\n",
    "                  verbose_eval=100,\n",
    "                  early_stopping_rounds=150,)\n",
    "best_itr = model2_pri.best_iteration"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": null,
   "metadata": {},
   "outputs": [],
   "source": [
    "###############训练模型结束！！！！！！！！！！！！！！！！！！！！！！！！！！！！！！！！！！去跑步了！！！！！！！！！\n",
    "###############下面是可视化部分\n",
    "###############将训练集中超过72天的数据完全抛弃，保留所有的测试集"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": null,
   "metadata": {},
   "outputs": [],
   "source": [
    "df_tmp = df_traintest8[(df_traintest8['day']<72) | (pd.isna(df_traintest8['ForecastId'])==False)].reset_index(drop=True)\n",
    "#########################选取了一段较长的的日期，筛选了训练集中72天内测试数据以及所有的训练数据\n",
    "###############################手动删除了之前聚合产生的特征\n",
    "df_tmp = df_tmp.drop([\n",
    "    'cases/day-(1-1)', 'cases/day-(1-7)', 'cases/day-(8-14)', 'cases/day-(15-21)', \n",
    "    'fatal/day-(1-1)', 'fatal/day-(1-7)', 'fatal/day-(8-14)', 'fatal/day-(15-21)',\n",
    "    'days_since_1cases', 'days_since_10cases', 'days_since_100cases',\n",
    "    'days_since_1fatal', 'days_since_10fatal', 'days_since_100fatal',\n",
    "                               ],  axis=1)\n",
    "df_traintest9 = []\n",
    "###################因为手动调整了每个地区的日期范围，所以需要重新滚动聚合\n",
    "for i, place in enumerate(places[:]):\n",
    "    df_tmp2 = df_tmp[df_tmp['place_id']==place].reset_index(drop=True)\n",
    "    df_tmp2 = do_aggregations(df_tmp2) \n",
    "    df_traintest9.append(df_tmp2)\n",
    "df_traintest9 = pd.concat(df_traintest9).reset_index(drop=True)\n",
    "df_traintest9[df_traintest9['day']>68].head()"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": null,
   "metadata": {},
   "outputs": [],
   "source": [
    "import seaborn as sns ###############熟悉的绘图库"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": null,
   "metadata": {},
   "outputs": [],
   "source": [
    "# Check the predictions of of Cases Public\n",
    "place = 'Bhutan' ############世界上某个地方\n",
    "# place = places[np.random.randint(len(places))]\n",
    "# place = 'Iran'\n",
    "df_interest_base = df_traintest9[df_traintest9['place_id']==place].reset_index(drop=True)\n",
    "df_interest = copy.deepcopy(df_interest_base)   ###############筛选出选择预测的区域\n",
    "#########################下面都是转换数据类型、\n",
    "#########################把训练集与测试集中超过年第72天的数据（其实就是训练集合中超过72天的数据）\n",
    "df_interest['ConfirmedCases'] = df_interest['ConfirmedCases'].astype(np.float)\n",
    "df_interest['cases/day'] = df_interest['cases/day'].astype(np.float)\n",
    "df_interest['fatal/day'] = df_interest['fatal/day'].astype(np.float)\n",
    "df_interest['Fatalities'] = df_interest['Fatalities'].astype(np.float)\n",
    "df_interest['cases/day'][df_interest['day']>=72] = -1\n",
    "df_interest['fatal/day'][df_interest['day']>=72] = -1\n",
    "len_known = (df_interest['cases/day']!=-1).sum()\n",
    "len_unknown = (df_interest['cases/day']==-1).sum()\n",
    "print(\"len train: {}, len prediction: {}\".format(len_known, len_unknown))\n",
    "###########################\n",
    "\n",
    "X_valid = df_interest[col_var][df_interest['day']>=72]\n",
    "X_valid2 = df_interest[col_var2][df_interest['day']>=72]\n",
    "pred_f =  np.exp(model.predict(X_valid))-1\n",
    "pred_c = np.exp(model2.predict(X_valid2))-1\n",
    "df_interest['fatal/day'][df_interest['day']>=72] = pred_f.clip(0, 1e10)\n",
    "df_interest['cases/day'][df_interest['day']>=72] = pred_c.clip(0, 1e10)\n",
    "df_interest['Fatalities'] = np.cumsum(df_interest['fatal/day'].values)\n",
    "df_interest['ConfirmedCases'] = np.cumsum(df_interest['cases/day'].values)\n",
    "for j in range(len_unknown): # use predicted cases and fatal for next days' prediction\n",
    "    X_valid = df_interest[col_var].iloc[j+len_known]\n",
    "    X_valid2 = df_interest[col_var2].iloc[j+len_known]\n",
    "    pred_f = model.predict(X_valid)\n",
    "    pred_c = model2.predict(X_valid2)\n",
    "    pred_c = (np.exp(pred_c)-1).clip(0, 1e10)\n",
    "    pred_f = (np.exp(pred_f)-1).clip(0, 1e10)\n",
    "    df_interest['fatal/day'][j+len_known] = pred_f\n",
    "    df_interest['cases/day'][j+len_known] = pred_c\n",
    "    df_interest['Fatalities'][j+len_known] = df_interest['Fatalities'][j+len_known-1] + pred_f\n",
    "    df_interest['ConfirmedCases'][j+len_known] = df_interest['ConfirmedCases'][j+len_known-1] + pred_c\n",
    "    df_interest = df_interest.drop([\n",
    "        'cases/day-(1-1)', 'cases/day-(1-7)', 'cases/day-(8-14)', 'cases/day-(15-21)', \n",
    "        'fatal/day-(1-1)', 'fatal/day-(1-7)', 'fatal/day-(8-14)', 'fatal/day-(15-21)', \n",
    "        'days_since_1cases', 'days_since_10cases', 'days_since_100cases',\n",
    "        'days_since_1fatal', 'days_since_10fatal', 'days_since_100fatal',\n",
    "                                   \n",
    "                                   ],  axis=1)\n",
    "    df_interest = do_aggregations(df_interest.reset_index(drop=True))\n",
    "\n",
    "# visualize\n",
    "tmp = df_interest['cases/day'].values\n",
    "tmp = np.cumsum(tmp)\n",
    "sns.lineplot(x=df_interest_base['day'], y=tmp, label='pred')\n",
    "tmp = df_traintest8['ConfirmedCases'][(df_traintest8['place_id']==place)& (pd.isna(df_traintest8['ForecastId']))].values\n",
    "print(len(tmp), tmp)\n",
    "sns.lineplot(x=df_traintest8['day'][(df_traintest8['place_id']==place)& (pd.isna(df_traintest8['ForecastId']))].values,\n",
    "             y=tmp, label='true')\n",
    "print(place)\n",
    "plt.show()"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": null,
   "metadata": {},
   "outputs": [],
   "source": [
    "###############################似乎有点莫名其妙，不太对啊"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": null,
   "metadata": {},
   "outputs": [],
   "source": [
    "last_day_train = df_traintest8['day'][pd.isna(df_traintest8['ForecastId'])].max()\n",
    "print(last_day_train)\n",
    "df_tmp = df_traintest8[\n",
    "    (pd.isna(df_traintest8['ForecastId'])) |\n",
    "    ((df_traintest8['day']>last_day_train) & (pd.isna(df_traintest8['ForecastId'])==False))].reset_index(drop=True)\n",
    "df_tmp = df_tmp.drop([\n",
    "    'cases/day-(1-1)', 'cases/day-(1-7)', 'cases/day-(8-14)', 'cases/day-(15-21)', \n",
    "    'fatal/day-(1-1)', 'fatal/day-(1-7)', 'fatal/day-(8-14)', 'fatal/day-(15-21)',\n",
    "    'days_since_1cases', 'days_since_10cases', 'days_since_100cases',\n",
    "    'days_since_1fatal', 'days_since_10fatal', 'days_since_100fatal',\n",
    "                               ],  axis=1)\n",
    "df_traintest10 = []\n",
    "for i, place in enumerate(places[:]):\n",
    "    df_tmp2 = df_tmp[df_tmp['place_id']==place].reset_index(drop=True)\n",
    "    df_tmp2 = do_aggregations(df_tmp2)\n",
    "    df_traintest10.append(df_tmp2)\n",
    "df_traintest10 = pd.concat(df_traintest10).reset_index(drop=True)\n",
    "df_traintest10[df_traintest10['day']>last_day_train-5].head(10)"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": null,
   "metadata": {},
   "outputs": [],
   "source": [
    "# Check the predictions of of Fatal Public\n",
    "place = 'Sweden'\n",
    "place = places[np.random.randint(len(places))]\n",
    "# place = 'Iran'\n",
    "df_interest_base = df_traintest9[df_traintest9['place_id']==place].reset_index(drop=True)\n",
    "df_interest = copy.deepcopy(df_interest_base)\n",
    "df_interest['ConfirmedCases'] = df_interest['ConfirmedCases'].astype(np.float)\n",
    "df_interest['cases/day'] = df_interest['cases/day'].astype(np.float)\n",
    "df_interest['fatal/day'] = df_interest['fatal/day'].astype(np.float)\n",
    "df_interest['Fatalities'] = df_interest['Fatalities'].astype(np.float)\n",
    "df_interest['cases/day'][df_interest['day']>=72] = -1\n",
    "df_interest['fatal/day'][df_interest['day']>=72] = -1\n",
    "len_known = (df_interest['cases/day']!=-1).sum()\n",
    "len_unknown = (df_interest['cases/day']==-1).sum()\n",
    "print(\"len train: {}, len prediction: {}\".format(len_known, len_unknown))\n",
    "X_valid = df_interest[col_var][df_interest['day']>=72]\n",
    "X_valid2 = df_interest[col_var2][df_interest['day']>=72]\n",
    "pred_f =  np.exp(model.predict(X_valid))-1\n",
    "pred_c = np.exp(model2.predict(X_valid2))-1\n",
    "df_interest['fatal/day'][df_interest['day']>=72] = pred_f.clip(0, 1e10)\n",
    "df_interest['cases/day'][df_interest['day']>=72] = pred_c.clip(0, 1e10)\n",
    "df_interest['Fatalities'] = np.cumsum(df_interest['fatal/day'].values)\n",
    "df_interest['ConfirmedCases'] = np.cumsum(df_interest['cases/day'].values)\n",
    "for j in range(len_unknown): # use predicted cases and fatal for next days' prediction\n",
    "    X_valid = df_interest[col_var].iloc[j+len_known]\n",
    "    X_valid2 = df_interest[col_var2].iloc[j+len_known]\n",
    "    pred_f = model.predict(X_valid)\n",
    "    pred_c = model2.predict(X_valid2)\n",
    "    pred_c = (np.exp(pred_c)-1).clip(0, 1e10)\n",
    "    pred_f = (np.exp(pred_f)-1).clip(0, 1e10)\n",
    "    df_interest['fatal/day'][j+len_known] = pred_f\n",
    "    df_interest['cases/day'][j+len_known] = pred_c\n",
    "    df_interest['Fatalities'][j+len_known] = df_interest['Fatalities'][j+len_known-1] + pred_f\n",
    "    df_interest['ConfirmedCases'][j+len_known] = df_interest['ConfirmedCases'][j+len_known-1] + pred_c\n",
    "    df_interest = df_interest.drop([\n",
    "        'cases/day-(1-1)', 'cases/day-(1-7)', 'cases/day-(8-14)', 'cases/day-(15-21)', \n",
    "        'fatal/day-(1-1)', 'fatal/day-(1-7)', 'fatal/day-(8-14)', 'fatal/day-(15-21)', \n",
    "        'days_since_1cases', 'days_since_10cases', 'days_since_100cases',\n",
    "        'days_since_1fatal', 'days_since_10fatal', 'days_since_100fatal',\n",
    "                                   \n",
    "                                   ],  axis=1)\n",
    "    df_interest = do_aggregations(df_interest.reset_index(drop=True))\n",
    "\n",
    "# visualize\n",
    "tmp = df_interest['fatal/day'].values\n",
    "tmp = np.cumsum(tmp)\n",
    "sns.lineplot(x=df_interest_base['day'], y=tmp, label='pred')\n",
    "tmp = df_traintest8['Fatalities'][(df_traintest8['place_id']==place)& (pd.isna(df_traintest8['ForecastId']))].values\n",
    "print(len(tmp), tmp)\n",
    "sns.lineplot(x=df_traintest8['day'][(df_traintest8['place_id']==place)& (pd.isna(df_traintest8['ForecastId']))].values,\n",
    "             y=tmp, label='true')\n",
    "print(place)\n",
    "plt.show()"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": null,
   "metadata": {},
   "outputs": [],
   "source": [
    "place = 'Bhutan'\n",
    "place = places[np.random.randint(len(places))]\n",
    "# place = 'Iran'\n",
    "df_interest_base = df_traintest10[df_traintest10['place_id']==place].reset_index(drop=True)\n",
    "df_interest = copy.deepcopy(df_interest_base)\n",
    "df_interest['ConfirmedCases'] = df_interest['ConfirmedCases'].astype(np.float)\n",
    "df_interest['cases/day'] = df_interest['cases/day'].astype(np.float)\n",
    "df_interest['fatal/day'] = df_interest['fatal/day'].astype(np.float)\n",
    "df_interest['Fatalities'] = df_interest['Fatalities'].astype(np.float)\n",
    "df_interest['cases/day'][df_interest['day']>last_day_train] = -1\n",
    "df_interest['fatal/day'][df_interest['day']>last_day_train] = -1\n",
    "len_known = (df_interest['cases/day']!=-1).sum()\n",
    "len_unknown = (df_interest['cases/day']==-1).sum()\n",
    "print(\"len train: {}, len prediction: {}\".format(len_known, len_unknown))\n",
    "X_valid = df_interest[col_var][df_interest['day']>84]\n",
    "X_valid2 = df_interest[col_var2][df_interest['day']>84]\n",
    "pred_f =  np.exp(model.predict(X_valid))-1\n",
    "pred_c = np.exp(model2.predict(X_valid2))-1\n",
    "df_interest['fatal/day'][df_interest['day']>last_day_train] = pred_f.clip(0, 1e10)\n",
    "df_interest['cases/day'][df_interest['day']>last_day_train] = pred_c.clip(0, 1e10)\n",
    "df_interest['Fatalities'] = np.cumsum(df_interest['fatal/day'].values)\n",
    "df_interest['ConfirmedCases'] = np.cumsum(df_interest['cases/day'].values)\n",
    "for j in range(len_unknown): # use predicted cases and fatal for next days' prediction\n",
    "    X_valid = df_interest[col_var].iloc[j+len_known]\n",
    "    X_valid2 = df_interest[col_var2].iloc[j+len_known]\n",
    "    pred_f = model_pri.predict(X_valid)\n",
    "    pred_c = model2_pri.predict(X_valid2)\n",
    "    pred_c = (np.exp(pred_c)-1).clip(0, 1e10)\n",
    "    pred_f = (np.exp(pred_f)-1).clip(0, 1e10)\n",
    "    df_interest['fatal/day'][j+len_known] = pred_f\n",
    "    df_interest['cases/day'][j+len_known] = pred_c\n",
    "    df_interest['Fatalities'][j+len_known] = df_interest['Fatalities'][j+len_known-1] + pred_f\n",
    "    df_interest['ConfirmedCases'][j+len_known] = df_interest['ConfirmedCases'][j+len_known-1] + pred_c\n",
    "    df_interest = df_interest.drop([\n",
    "        'cases/day-(1-1)', 'cases/day-(1-7)', 'cases/day-(8-14)', 'cases/day-(15-21)', \n",
    "        'fatal/day-(1-1)', 'fatal/day-(1-7)', 'fatal/day-(8-14)', 'fatal/day-(15-21)', \n",
    "        'days_since_1cases', 'days_since_10cases', 'days_since_100cases',\n",
    "        'days_since_1fatal', 'days_since_10fatal', 'days_since_100fatal',\n",
    "                                   \n",
    "                                   ],  axis=1)\n",
    "    df_interest = do_aggregations(df_interest.reset_index(drop=True))\n",
    "\n",
    "# visualize\n",
    "tmp = df_interest['cases/day'].values\n",
    "tmp = np.cumsum(tmp)\n",
    "sns.lineplot(x=df_interest_base['day'], y=tmp, label='pred')\n",
    "tmp = df_traintest10['ConfirmedCases'][(df_traintest10['place_id']==place)& (pd.isna(df_traintest10['ForecastId']))].values\n",
    "print(len(tmp), tmp)\n",
    "sns.lineplot(x=df_traintest10['day'][(df_traintest10['place_id']==place)& (pd.isna(df_traintest10['ForecastId']))].values,\n",
    "             y=tmp, label='true')\n",
    "print(place)\n",
    "plt.show()"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": null,
   "metadata": {},
   "outputs": [],
   "source": [
    "# Check the predictions of of Fatal Private\n",
    "place = 'Bhutan'\n",
    "place = places[np.random.randint(len(places))]\n",
    "# place = 'Iran'\n",
    "df_interest_base = df_traintest10[df_traintest10['place_id']==place].reset_index(drop=True)\n",
    "df_interest = copy.deepcopy(df_interest_base)\n",
    "df_interest['ConfirmedCases'] = df_interest['ConfirmedCases'].astype(np.float)\n",
    "df_interest['cases/day'] = df_interest['cases/day'].astype(np.float)\n",
    "df_interest['fatal/day'] = df_interest['fatal/day'].astype(np.float)\n",
    "df_interest['Fatalities'] = df_interest['Fatalities'].astype(np.float)\n",
    "df_interest['cases/day'][df_interest['day']>last_day_train] = -1\n",
    "df_interest['fatal/day'][df_interest['day']>last_day_train] = -1\n",
    "len_known = (df_interest['cases/day']!=-1).sum()\n",
    "len_unknown = (df_interest['cases/day']==-1).sum()\n",
    "print(\"len train: {}, len prediction: {}\".format(len_known, len_unknown))\n",
    "X_valid = df_interest[col_var][df_interest['day']>84]\n",
    "X_valid2 = df_interest[col_var2][df_interest['day']>84]\n",
    "pred_f =  np.exp(model.predict(X_valid))-1\n",
    "pred_c = np.exp(model2.predict(X_valid2))-1\n",
    "df_interest['fatal/day'][df_interest['day']>last_day_train] = pred_f.clip(0, 1e10)\n",
    "df_interest['cases/day'][df_interest['day']>last_day_train] = pred_c.clip(0, 1e10)\n",
    "df_interest['Fatalities'] = np.cumsum(df_interest['fatal/day'].values)\n",
    "df_interest['ConfirmedCases'] = np.cumsum(df_interest['cases/day'].values)\n",
    "for j in range(len_unknown): # use predicted cases and fatal for next days' prediction\n",
    "    X_valid = df_interest[col_var].iloc[j+len_known]\n",
    "    X_valid2 = df_interest[col_var2].iloc[j+len_known]\n",
    "    pred_f = model_pri.predict(X_valid)\n",
    "    pred_c = model2_pri.predict(X_valid2)\n",
    "    pred_c = (np.exp(pred_c)-1).clip(0, 1e10)\n",
    "    pred_f = (np.exp(pred_f)-1).clip(0, 1e10)\n",
    "    df_interest['fatal/day'][j+len_known] = pred_f\n",
    "    df_interest['cases/day'][j+len_known] = pred_c\n",
    "    df_interest['Fatalities'][j+len_known] = df_interest['Fatalities'][j+len_known-1] + pred_f\n",
    "    df_interest['ConfirmedCases'][j+len_known] = df_interest['ConfirmedCases'][j+len_known-1] + pred_c\n",
    "    df_interest = df_interest.drop([\n",
    "        'cases/day-(1-1)', 'cases/day-(1-7)', 'cases/day-(8-14)', 'cases/day-(15-21)', \n",
    "        'fatal/day-(1-1)', 'fatal/day-(1-7)', 'fatal/day-(8-14)', 'fatal/day-(15-21)', \n",
    "        'days_since_1cases', 'days_since_10cases', 'days_since_100cases',\n",
    "        'days_since_1fatal', 'days_since_10fatal', 'days_since_100fatal',\n",
    "                                   \n",
    "                                   ],  axis=1)\n",
    "    df_interest = do_aggregations(df_interest.reset_index(drop=True))\n",
    "\n",
    "# visualize\n",
    "tmp = df_interest['fatal/day'].values\n",
    "tmp = np.cumsum(tmp)\n",
    "sns.lineplot(x=df_interest_base['day'], y=tmp, label='pred')\n",
    "tmp = df_traintest10['Fatalities'][(df_traintest10['place_id']==place)& (pd.isna(df_traintest10['ForecastId']))].values\n",
    "print(len(tmp), tmp)\n",
    "sns.lineplot(x=df_traintest10['day'][(df_traintest10['place_id']==place)& (pd.isna(df_traintest10['ForecastId']))].values,\n",
    "             y=tmp, label='true')\n",
    "print(place)\n",
    "plt.show()"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": null,
   "metadata": {},
   "outputs": [],
   "source": []
  }
 ],
 "metadata": {
  "kernelspec": {
   "display_name": "Python 3",
   "language": "python",
   "name": "python3"
  },
  "language_info": {
   "codemirror_mode": {
    "name": "ipython",
    "version": 3
   },
   "file_extension": ".py",
   "mimetype": "text/x-python",
   "name": "python",
   "nbconvert_exporter": "python",
   "pygments_lexer": "ipython3",
   "version": "3.7.6"
  }
 },
 "nbformat": 4,
 "nbformat_minor": 4
}
